結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
👑 |
提出日時 | 2020-01-19 12:49:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 370 bytes |
コンパイル時間 | 560 ms |
コンパイル使用メモリ | 67,380 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 19:25:50 |
合計ジャッジ時間 | 1,235 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:15:14: warning: 'ti' may be used uninitialized [-Wmaybe-uninitialized] 15 | ti = ((ti+z)%12); | ~~~^~~ main.cpp:6:9: note: 'ti' was declared here 6 | int ti; | ^~
ソースコード
#include <iostream> using namespace std; string t[12] = {"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; int main(){ string s;cin>>s; int ti; for(int i = 0; 12 > i; i++){ if(t[i] == s){ ti = i; break; } } int z;cin>>z; z = ((z+2400)%12); ti = ((ti+z)%12); cout << t[ti] << endl; }