結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2025-03-17 14:49:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 327 bytes |
コンパイル時間 | 288 ms |
コンパイル使用メモリ | 28,416 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-17 14:49:06 |
合計ジャッジ時間 | 1,236 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s %d", str, &num); | ~~~~~^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int main(void) { char roman[12][5]={"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}, str[5]; int num; scanf("%s %d", str, &num); for (int i = 0; i < 12; i ++) { if (strcmp(roman[i],str) == 0) { printf("%s\n", roman[(1008 + i + num) % 12]); } } }