結果

問題 No.441 和か積
ユーザー olphe
提出日時 2016-11-11 22:28:48
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 54,980 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-25 08:28:32
合計ジャッジ時間 1,188 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 22 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:34: warning: NULL used in arithmetic [-Wpointer-arith]
   10 |                 if (num[0][i] == NULL) {
      |                                  ^~~~
main.cpp:16:34: warning: NULL used in arithmetic [-Wpointer-arith]
   16 |                 if (num[1][i] == NULL) {
      |                                  ^~~~

ソースコード

diff #

#include "iostream"
using namespace std;

char num[2][100];
int a, b;

int main() {
	cin >> num[0] >> num[1];
	for (int i = 0; i < 100; i++) {
		if (num[0][i] == NULL) {
			a = i;
			break;
		}
	}
	for (int i = 0; i < 100; i++) {
		if (num[1][i] == NULL) {
			b = i;
			break;
		}
	}
	if (a > 1)a = 3;
	else a = num[0][0]-'0';
	if (b > 1)b = 3;
	else b = num[1][0]-'0';
	if (a == b&&a == 2)cout << "E";
	else if (a == 1 || b == 1)cout << "S";
	else cout << "P";
	cout << "\n";
	return 0;
}
0