535A - Tavas and Nafas (535Tavas and Nafas )
- 535A - Tavas and Nafas
- ///bismillah
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- vector<string> v ={"zero","one","two",
- "three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fiveteen","sixteen","seventeen","eighteen","nineteen","twenty"};
- string s;
- cin>>s;int d=s.length();
- if(s.length()==1){
- int x=s[0]-48;
- cout <<v[x];
- }
- if(d==2 and s=="10"){ cout<<"ten"; }
- if(d==2 and s=="11"){ cout<<"eleven"; }
- if(d==2 and s=="12"){ cout<<"twelve"; }
- if(d==2 and s=="13"){ cout<<"thirteen"; }
- if(d==2 and s=="14"){ cout<<"fourteen"; }
- if(d==2 and s=="15"){ cout<<"fifteen"; }
- if(d==2 and s=="16"){ cout<<"sixteen"; }
- if(d==2 and s=="17"){ cout<<"seventeen"; }
- if(d==2 and s=="18"){ cout<<"eighteen"; }
- if(d==2 and s=="19"){ cout<<"nineteen"; }
- if(d==2 and s[0]=='2'){ cout <<"twenty";
- int x=s[1]-48;
- if(x!=0) cout<<"-"<<v[x];}
- if(d==2 and s[0]=='3'){ cout <<"thirty";
- int x=s[1]-48;
- if(x!=0) cout<<"-"<<v[x];}
- if(d==2 and s[0]=='4'){ cout <<"forty";
- int x=s[1]-48;
- if(x!=0) cout<<"-"<<v[x];}
- if(d==2 and s[0]=='5'){ cout <<"fifty";
- int x=s[1]-48;
- if(x!=0) cout<<"-"<<v[x];}
- if(d==2 and s[0]=='6'){ cout <<"sixty";
- int x=s[1]-48;
- if(x!=0) cout<<"-"<<v[x];}
- if(d==2 and s[0]=='7'){ cout <<"seventy";
- int x=s[1]-48;
- if(x!=0) cout<<"-"<<v[x];}
- if(d==2 and s[0]=='8'){ cout <<"eighty";
- int x=s[1]-48;
- if(x!=0) cout<<"-"<<v[x];}
- if(d==2 and s[0]=='9'){ cout <<"ninety";
- int x=s[1]-48;
- if(x!=0) cout<<"-"<<v[x];}
- }

Comments
Post a Comment