Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int a,chuc,donvi;
- cout<<"nhap vao mot so nguyen tu 1 den 100: ";
- cin>>a;
- chuc=a/10;
- donvi=a%10;
- if(a<1||a>100)
- {cout<<"khong hop le";}
- else
- {
- switch(chuc)
- {
- case 1:{cout<<"muoi ";break;}
- case 2:{cout<<"hai muoi ";break;}
- case 3:{cout<<"ba muoi ";break;}
- case 4:{cout<<"bon muoi ";break;}
- case 5:{cout<<"nam muoi ";break;}
- case 6:{cout<<"sau muoi ";break;}
- case 7:{cout<<"bay muoi ";break;}
- case 8:{cout<<"tam muoi ";break;}
- case 9:{cout<<"chin muoi ";break;}
- }
- switch(donvi)
- {
- case 1:{cout<<"mot";break;}
- case 2:{cout<<"hai";break;}
- case 3:{cout<<"ba";break;}
- case 4:{cout<<"bon";break;}
- case 5:{
- if(chuc==0)
- {
- cout<<"nam";
- }
- else
- {
- cout<<"lam";
- }
- break;}
- case 6:{cout<<"sau";break;}
- case 7:{cout<<"bay";break;}
- case 8:{cout<<"tam";break;}
- case 9:{cout<<"chin";break;}
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement