結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー olpheolphe
提出日時 2016-11-18 22:32:01
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 737 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 53,468 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 17:48:06
合計ジャッジ時間 908 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:41: warning: NULL used in arithmetic [-Wpointer-arith]
    9 |         for (int i = 0; letter[0][i] != NULL;i++) {
      |                                         ^~~~
main.cpp:15:41: warning: NULL used in arithmetic [-Wpointer-arith]
   15 |         for (int i = 0; letter[1][i] != NULL; i++) {
      |                                         ^~~~
main.cpp:23:46: warning: NULL used in arithmetic [-Wpointer-arith]
   23 |         if (start[0] == 0 && letter[0][1] != NULL) {
      |                                              ^~~~
main.cpp:27:46: warning: NULL used in arithmetic [-Wpointer-arith]
   27 |         if (start[1] == 0 && letter[1][1] != NULL) {
      |                                              ^~~~

ソースコード

diff #

#include "iostream"
using namespace std;

char letter[2][6];
int start[2];

int main() {
	cin >> letter[1] >> letter[0];
	for (int i = 0; letter[0][i] != NULL;i++) {
		if ((letter[0][i] >= 'a'&&letter[0][i] <= 'z') || (letter[0][i] >= 'A'&&letter[0][i] <= 'Z')) {
			cout << "NG\n";
			return 0;
		}
	}
	for (int i = 0; letter[1][i] != NULL; i++) {
		if ((letter[1][i] >= 'a'&&letter[1][i] <= 'z') || (letter[1][i] >= 'A'&&letter[1][i] <= 'Z')) {
			cout << "NG\n";
			return 0;
		}
	}
	start[0] = letter[0][0] - '0';
	start[1] = letter[1][0] - '0';
	if (start[0] == 0 && letter[0][1] != NULL) {
		cout << "NG\n";
		return 0;
	}
	if (start[1] == 0 && letter[1][1] != NULL) {
		cout << "NG\n";
		return 0;
	}
	cout << "OK\n";
	return 0;
}
0