Baxtiyarov Jahangir 120-20


Download 18.51 Kb.
Sana18.03.2023
Hajmi18.51 Kb.
#1283373
Bog'liq
Injinering


Baxtiyarov Jahangir 120-20

res = ""
raqam = ["bir","ikki","uch","to'rt","besh","olti","yetti","sakkiz","to'qqiz"]
son = ["o'n","yigirma","o'ttiz","qirq","ellik","oltmish","yetmish","sakson","to'qson"]
nom = ["yuz","ming","million","milliard"]
str = input()
str = str[::-1]
for i in range(len(str)):
if(str[i]!='0'):
if((i+1)%3==1):
if(i+1!=1):
res=" "+raqam[ord(str[i])-49]+" "+nom[(i+1)//3]+res
else:
res=" "+raqam[ord(str[i])-49]+" "+res
elif((i+1)%3==2):
if(ord(str[i-1])==48 and i+1!=2):
res=" "+son[ord(str[i])-49]+" "+nom[(i+1)//3]+res
else:
res=" "+son[ord(str[i])-49]+res
else:
if(ord(str[i-1])==48 and i+1!=3):
res=" "+raqam[ord(str[i])-49]+" yuz "+nom[(i+1)//3-1]+res
else:
res=" "+raqam[ord(str[i])-49]+" yuz"+res
print(res)
Download 18.51 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling