selamat datang para pengunjung anda pengunjung yang ke

Minggu, 15 Maret 2009

program c#angka menjadi kalimat

/---------------------------------------------------------------------------

#pragma hdrstop

//---------------------------------------------------------------------------

#pragma argsused
#include
#include

int main(){
int i, a, b, c;
string x, y, z;
cin>>i;
if(0<=i<=99){
if(i>=10){
a = i/10;
c = i%10;
i = c;
}
if(i>=0){
b = i/1;
}
}
else if (i>=100){
cout<<"Nilai males"< cout< }


if(a ==1 && b ==0){x = "sepuluh ";}
else if(a ==1 && b ==1){x = "sebelas ";}
else if(a ==1 && b ==2){x = "dua belas ";}
else if(a ==1 && b ==3){x = "tiga belas ";}
else if(a ==1 && b ==4){x = "empat belas ";}
else if(a ==1 && b ==5){x = "lima belas ";}
else if(a ==1 && b ==6){x = "enam belas ";}
else if(a ==1 && b ==7){x = "tujuh belas ";}
else if(a ==1 && b ==8){x = "delapan belas ";}
else if(a ==1 && b ==9){x = "sembilan belas ";}

if (a == 0){y = "";}
else if (a ==2){y = "dua puluh ";}
else if (a ==3){y = "tiga puluh ";}
else if (a ==4){y = "empat puluh ";}
else if (a ==5){y = "lima puluh ";}
else if (a ==6){y = "enam puluh ";}
else if (a ==7){y = "tujuh puluh ";}
else if (a ==8){y = "delapan puluh ";}
else if (a ==9){y = "sembilan puluh ";}

if (b == 0){z ="";}
else if (b == 1){z = "satu";}
else if (b == 2){z = "dua";}
else if (b == 3){z = "tiga";}
else if (b == 4){z = "empat";}
else if (b == 5){z = "lima";}
else if (b == 6){z = "enam";}
else if (b == 7){z = "tujuh";}
else if (b == 8){z = "delapan";}
else if (b == 9){z = "sembilan";}

if(a==1){
cout< }else{
cout< cout< }
getch();

Tidak ada komentar:

Posting Komentar

silahkan berkomentar