krujeen / python

0 stars 0 forks source link

แปลงค่าเงินเยน #2

Open krujeen opened 3 years ago

krujeen commented 3 years ago

จงเขียนโปรแกมแปลงค่าเงินบาท เป็นสกุลเงินเยน(JPY) และ เซ็น (sen) ของประเทศญี่ปุ่น โดยใช้อัตราแลกเปลี่ยน (ณ วันที่ 24/4/2564) 100 บาท เท่ากับ 343.44 เยน และ 100 เซ็น เท่ากับ 1 เยน

ข้อมูลนำเข้า จำนวนเงิน หน่วยเป็น บาท (จำนวนเต็ม) ข้อมูลส่งออก เงินเยน (จำนวนเต็ม) เซ็น (จำนวนเต็ม)

ตัวอย่าง1 input

100

output

343
44

ตัวอย่าง2 input

123

output

422
43
krujeen commented 3 years ago
import math
x = int(input())
print ('%.0f'%(x*343.44/100))
print ('%.0f'%(x*343.44%100))