結果
問題 | No.441 和か積 |
ユーザー |
![]() |
提出日時 | 2016-11-17 17:32:54 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 678 bytes |
コンパイル時間 | 196 ms |
コンパイル使用メモリ | 21,248 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 03:35:55 |
合計ジャッジ時間 | 1,029 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%s%s", a, b); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <stdlib.h>#include <string.h>int main(void){char a[201], b[201];int a_len, b_len, ia, ib, m, s;scanf("%s%s", a, b);a_len = strlen(a);b_len = strlen(b);if ((a_len == 1) && (b_len == 1)) {ia = atoi(a);ib = atoi(b);m = ia * ib;s = ia + ib;if (m == s) {printf("E\n");}else if (m > s) {printf("P\n");}else {printf("S\n");}}else if (a_len == 1) {ia = atoi(a);if (ia > 1) {printf("P\n");}else {printf("S\n");}}else if (b_len == 1) {ib = atoi(b);if (ib > 1) {printf("P\n");}else {printf("S\n");}}else {printf("P\n");}return 0;}