-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04_P26.py
More file actions
55 lines (48 loc) · 1.29 KB
/
04_P26.py
File metadata and controls
55 lines (48 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
lek = ['soon','nueng','song','sam','see','ha','hok','jed','pad','kao','sip']
luk = ['','sip','roey','pun','muen','saen','larn']
def re(a):
stank = ""
i = len(a)-1
while i>=0:
stank += a[i]
i-=1
return stank
def COUNT(a):
stank = ""
i = 0
A = len(a)
while i<A:
if i%6==0 and i>0:
stank = 'larn-'+stank
elif A==1 :
stank = lek[ord(a[i])-48]
break
if i%6>0 and a[i]!='0':
stank = luk[i%6] + '-' + stank
if i+1<A and i%6 == 0 and a[i+1]>'0' and a[i]=='1':
stank = 'ed-' + stank
elif i%6 == 1 and a[i]=='2':
stank = 'yee-' + stank
elif not(a[i]=='1' and i%6==1) and a[i]!='0':
stank = lek[ord(a[i])-48] + '-' + stank
i+=1
#print(stank,'/eeii')
if stank[len(stank)-1]=='-':
stank = stank[:len(stank)-1]
return stank
a = input()
A_prime = ''
for i in a:
if i!=',':
A_prime += i
a = A_prime
if a[0]=='-':
print('lop-',end='')
a = a[1:]
if a.find('.') != -1:
index = a.find('.')
print(COUNT(re(a[:index])),'-jood',sep='',end='')
for i in a[index+1:] :
print('-',lek[ord(i)-48],sep='',end='')
else:
print(COUNT(re(a)))