結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー 一ノ瀬卯月
提出日時 2019-03-04 14:05:34
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 491 bytes
コンパイル時間 483 ms
コンパイル使用メモリ 56,580 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 13:27:22
合計ジャッジ時間 1,651 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 10 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>

using namespace std;
int main()
{
	string s[2];
	short cknum[2];
	bool flag = false;
	cin >> s[0] >> s[1];
	for (int i = 0; i < 2; i++)
	{
		cknum[i] = stoi(s[i]);
		
		if (cknum[i]>12345 || s[i].size()>=2 && s[i].at(0) == '0') flag = true;
		else
		{
			for (unsigned int j = 0; j < s[i].length(); j++)
			{
				if (!(s[i].at(j) >= 48 && s[i].at(j) <= 57))
				{
					flag = true;
				}
			}
		}
	}

	cout << (flag ? "NG" : "OK") << endl;
	return 0;
}
0