結果
| 問題 |
No.405 ローマ数字の腕時計
|
| ユーザー |
asdfghjkl;
|
| 提出日時 | 2020-03-20 19:17:08 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 932 bytes |
| コンパイル時間 | 471 ms |
| コンパイル使用メモリ | 30,848 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 19:26:56 |
| 合計ジャッジ時間 | 1,157 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(void){
char s[10];
int t;
int now=0;
scanf("%s",s);
scanf("%d",&t);
for(int i=0;s[i]!='\0';i++){
if(s[0]=='I'&&s[1]=='X'){now=9;break;}
else{
if(s[i]=='I'){now++;}
else if(s[i]=='V'){now=now+5;}
else{now=now+10;}
}
}
now=now+t;
for(;;){
if(now<0){now=now+24;}
else if(now>24){now=now-24;}
else{break;}
}
if(now==0||now==24||now==12){printf("XII\n");}
else if(now==1||now==13){printf("I\n");}
else if(now==2||now==14){printf("II\n");}
else if(now==3||now==15){printf("III\n");}
else if(now==4||now==16){printf("IIII\n");}
else if(now==5||now==17){printf("V\n");}
else if(now==6||now==18){printf("VI\n");}
else if(now==7||now==19){printf("VII\n");}
else if(now==8||now==20){printf("VIII\n");}
else if(now==9||now==21){printf("IX\n");}
else if(now==10||now==22){printf("X\n");}
else if(now==11||now==23){printf("XI\n");}
}
asdfghjkl;