結果

問題 No.441 和か積
ユーザー butsurizuki
提出日時 2016-11-11 23:01:18
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 487 bytes
コンパイル時間 796 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 03:27:16
合計ジャッジ時間 1,268 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s%s",s,t);
      |         ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<string.h>

int main(void){
	int x,y,c=0;
	char s[256],t[256];
	scanf("%s%s",s,t);
	x = strcmp(s,"0");
	y = strcmp(t,"0");
	if(!(x) && !(y)){printf("E\n");return 0;}
	x = strcmp(s,"2");
	y = strcmp(t,"2");
	if(!(x) && !(y)){printf("E\n");return 0;}
	x = strcmp(s,"0");
	if(x == 0){c=1;}
	x = strcmp(s,"1");
	if(x == 0){c=1;}
	x = strcmp(t,"0");
	if(x == 0){c=1;}
	x = strcmp(t,"1");
	if(x == 0){c=1;}
	if(c){printf("S\n");return 0;}
	printf("P\n");
	return 0;
}
0