結果

問題 No.441 和か積
ユーザー olpheolphe
提出日時 2016-11-11 22:31:17
言語 C++11
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 517 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 53,980 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 01:08:22
合計ジャッジ時間 1,577 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
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)||(a==b&&a==0))cout << "E";
	else if (a == 1 || b == 1||a==0||b==0)cout << "S";
	else cout << "P";
	cout << "\n";
	return 0;
}
0