結果
問題 | No.441 和か積 |
ユーザー |
![]() |
提出日時 | 2016-11-18 01:00:14 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 629 bytes |
コンパイル時間 | 276 ms |
コンパイル使用メモリ | 21,248 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 03:36:19 |
合計ジャッジ時間 | 1,148 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
コンパイルメッセージ
main.c: In function ‘func’: main.c:7:13: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration] 7 | i = atoi(a); | ^~~~ main.c: In function ‘main’: main.c:19:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | scanf("%s %s",A,B); | ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int func(char *a){ int i; i = atoi(a); if(i == 0) return 1; else if(i == 1) return 1; else return 0; } int main(){ char A[201],B[201]; scanf("%s %s",A,B); int Alen,Blen; Alen = strlen(A); Blen = strlen(B); if(Alen == 1 && Blen == 1){ int a,b; a=atoi(A); b=atoi(B); if(a+b>a*b) printf("S\n"); else if(a*b>a+b) printf("P\n"); else printf("E\n"); } else if(Alen ==1){ if(func(A)==1) printf("S\n"); else printf("P\n"); } else if(Blen ==1){ if(func(B)==1) printf("S\n"); else printf("P\n"); } else printf("P\n"); return 0; }