Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
NumberToWords
//g++ 7.4.0 #include <bits/stdc++.h> using namespace std; #define ll long long #define boost ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); const int MAX = 1000001; string Name[20]={"","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"}; string T[9]={"","Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"}; string M[5]={""," Thousand", " Million", " Billion", " Trillion"}; string nameit(int n) { string ans=""; if((n<1000)&&(n>99) ) { ans = Name[n/100]+" Hundred "; } n %=100; if(n<20) ans += Name[n]; if(n>19&&n<100) ans += (T[(n/10)-1]+" "+Name[n%10]); return ans; } string check(string s) { string ans=""; for(int I=0;I<(int)s.length()-1 ;) { if(s[I]==' '&&s[I+1]==' ') {ans+=s[I];I+=2;} else{ ans+=s[I];I++; } } return ans; } void solve() { for(int I=0;I<10;I++) { } cout<<ans<<endl; } int main() {boost; int t;cin>>t;while(t--)solve() ; }
run
|
edit
|
history
|
help
0
is_sorted_30-Seconds-of-C++
4149 coj WIP
remove_copy_if-30-Seconds-of-C++
UsingAlgorithm
gp series
container access all elements
shell sort
Do While Meteoro Agustin
Bin Tree build
Mirror a binary tree