#24643: 張溢城


alvinhuang0603@gmail.com (黃皓群)

學校 : 國立嘉義高級中學
編號 : 145830
來源 : [101.9.53.158]
最後登入時間 :
2024-04-16 18:25:25
e972. 1. 貨幣轉換 (Currency) -- 2019年5月TOI練習賽新手組 | From: [163.27.3.91] | 發表日期 : 2021-03-12 13:09

#include<iostream>
#include<iomanip>
using namespace std;
int main(){
double a,b;
char c;
while(cin>>a>>b>>c){
if(c=='U'){
    if(a/30.9-b>=0)
    cout<<fixed<<setprecision(2)<<"U"<<" "<<a/30.9-b<<endl;
    else
    cout<<"No Money"<<endl;
}
if(c=='E'){
    if(a/34.5-b>=0)
    cout<<fixed<<setprecision(2)<<"E"<<" "<<(double)a/34.5-b<<endl;
    else
    cout<<"No Money"<<endl;
}
if(c=='J'){
    if(a/0.28-b>=0)
    cout<<fixed<<setprecision(2)<<"J"<<" "<<a/0.28-b<<endl;
    else
    cout<<"No Money"<<endl;
}
if(c=='T'){
    if(a-b>=0)
    cout<<fixed<<setprecision(2)<<"T"<<" "<<a-b<<endl;
    else
    cout<<"No Money"<<endl;
}
}
return 0;
}
 
ZeroJudge Forum