結果
| 問題 |
No.405 ローマ数字の腕時計
|
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-17 14:48:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 320 bytes |
| コンパイル時間 | 332 ms |
| コンパイル使用メモリ | 28,160 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-17 14:48:47 |
| 合計ジャッジ時間 | 1,324 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 10 |
コンパイルメッセージ
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[(i + num) % 12]);
}
}
}
sasa