結果
| 問題 | No.49 算数の宿題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-06 19:26:46 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 5,000 ms |
| + 693µs | |
| コード長 | 279 bytes |
| 記録 | |
| コンパイル時間 | 39 ms |
| コンパイル使用メモリ | 28,032 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-24 06:45:19 |
| 合計ジャッジ時間 | 1,362 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:13:5: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
13 | printf("%d",!r?(m+s):(r<0?s:(m*s)));
| ^~~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+++ |+#include <stdio.h>
1 |
ソースコード
int main(){
int s=0,r=-1,m=-1,c;
while((c=getchar())!=-1){
if ('0'<=c){
s=s*10+c-'0';
}else{
m=!r?(m+s):(r<0?s:(m*s));
r=c=='+';
s=0;
}
}
printf("%d",!r?(m+s):(r<0?s:(m*s)));
return 0;
}