Chuyen so tien bang so sang chu code c
using namespace std;
#include <iostream>
int main () {
int n = 0 ;
cout << "nhap so n=";
cin >> n;
int donVi = n % 10;
int hangChuc = (n % 100) / 10;
int tram = n / 100;
switch (tram)
{
case 0: {
cout<<"Không tram ";
break;
}
case 1: {
cout<<"Mot tram ";
break;
}
case 2:{
cout<<"Hai tram ";
break;
}
case 3: {
cout<<"Ba tram ";
break;
}
case 4:{
cout<<"Bon tram ";
break;
}
case 5: {
cout<<"Nam tram ";
break;
}
case 6: {
cout<<"Sau tram ";
break;
}
case 7: {
cout<<"Bay tram ";
break;
}
case 8:{
cout<<"Tam tram ";
break;
}
case 9: {
cout<<"Chin tram ";
break;
}
}
switch (hangChuc)
{
case 0: {
switch (donVi)
{
case 0 :{
break;
}
default:{
cout<<"le ";
break;
}
}
break;
}
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;
}
}
}