結果

問題 No.405 ローマ数字の腕時計
ユーザー Kura
提出日時 2019-02-19 22:21:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,167 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 57,976 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-12 22:27:52
合計ジャッジ時間 1,834 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
using namespace std;
int main() {
	string s; int n;
	cin >> s >> n;
	if (s == "I") {
		n = (1 + n) % 12;
	}else if (s == "II") {
		n = (2 + n) % 12;
	}
	else if(s == "III") {
		n = (3 + n) % 12;
	}
	else if (s == "IIII") {
		n = (4 + n) % 12;
	}
	else if (s == "V") {
		n = (5 + n) % 12;
	}
	else if (s == "VI") {
		n = (6 + n) % 12;
	}
	else if (s == "VII") {
		n = (7 + n) % 12;
	}
	else if (s == "VIII") {
		n = (8 + n) % 12;
	}
	else if (s == "IX") {
		n = (9 + n) % 12;
	}
	else if (s == "X") {
		n = (10 + n) % 12;
	}
	else if (s == "XI") {
		n = (11 + n) % 12;
	}
	else{
		n = (12 + n) % 12;
	}
	switch (n)
	{
	case 0:
		cout << "XII" << endl;
		break;
	case 1:
		cout << "I" << endl;
		break;
	case 2:
		cout << "II" << endl;
		break;
	case 3:
		cout << "III" << endl;
		break;
	case 4:
		cout << "IIII" << endl;
		break;
	case 5:
		cout << "V" << endl;
		break;
	case 6:
		cout << "VI" << endl;
		break;
	case 7:
		cout << "VII" << endl;
		break;
	case 8:
		cout << "VIII" << endl;
		break;
	case 9:
		cout << "IX" << endl;
		break;
	case 10:
		cout << "X" << endl;
		break;
	case 11:
		cout << "XI" << endl;
		break;
	}
}
0