結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2016-10-11 22:28:13 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 329 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 04:17:15 |
合計ジャッジ時間 | 897 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 17 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:10:9: 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(void) { int i; char s1[1000]; char *s2[] = {"XII", "I","II","III","IIII","V","VI", "VII","VIII","IX","X","XI"}; int t; int k; scanf("%s%d",s1,&t); for(i=0;i<12;i++){ if(strstr(s1,s2[i])) break; } i+=t; i%=12; if(i<0){ i+=12; } printf("%s\n",s2[i]); return 0; }