結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2016-08-09 03:30:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 860 bytes |
コンパイル時間 | 454 ms |
コンパイル使用メモリ | 56,316 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-12-24 04:07:33 |
合計ジャッジ時間 | 1,413 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 WA * 2 |
ソースコード
#include<iostream> #include<string> using namespace std; int main(){ string S; int T; cin>>S>>T; if(S=="I") T+=1; else if(S=="II") T+=2; else if(S=="9II") T+=3; else if(S=="IIII") T+=4; else if(S=="V") T+=5; else if(S=="VI") T+=6; else if(S=="VII") T+=7; else if(S=="VIII") T+=8; else if(S=="IX") T+=9; else if(S=="X") T+=10; else if(S=="XI") T+=11; else if(S=="XII") T+=12; while(T<=0||T>=13){ if(T<=0) T+=12; if(T>=13) T-=12; } if(T==1) cout<<"I"<<endl; else if(T==2) cout<<"II"<<endl; else if(T==3) cout<<"III"<<endl; else if(T==4) cout<<"IIII"<<endl; else if(T==5) cout<<"V"<<endl; else if(T==6) cout<<"VI"<<endl; else if(T==7) cout<<"VII"<<endl; else if(T==8) cout<<"VIII"<<endl; else if(T==9) cout<<"IX"<<endl; else if(T==10) cout<<"X"<<endl; else if(T==11) cout<<"XI"<<endl; else if(T==12) cout<<"XII"<<endl; }