結果
| 問題 |
No.405 ローマ数字の腕時計
|
| ユーザー |
mudbdb
|
| 提出日時 | 2016-08-05 22:41:37 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 375 bytes |
| コンパイル時間 | 104 ms |
| コンパイル使用メモリ | 21,248 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 18:59:37 |
| 合計ジャッジ時間 | 841 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%s %d",S1,&T);
| ^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main() {
char *S2[] = {"XII",
"I","II","III","IIII","V","VI",
"VII","VIII","IX","X","XI"};
char S1[10];
int T;
int i;
scanf("%s %d",S1,&T);
for (i=0; i<12; i++) {
if (strcmp(S1,S2[i]) == 0) break;
}
i+=T;
i%=12;
if (i<0) {
i+=12;
}
printf("%s\n",S2[i]);
return 0;
}
mudbdb