結果
| 問題 |
No.49 算数の宿題
|
| コンテスト | |
| ユーザー |
akakimidori
|
| 提出日時 | 2015-07-27 00:57:44 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 242 bytes |
| コンパイル時間 | 169 ms |
| コンパイル使用メモリ | 20,096 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-23 01:46:04 |
| 合計ジャッジ時間 | 772 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&d);
| ^~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%c",&c);
| ^~~~~~~~~~~~~~
main.c:11:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d",&t);
| ^~~~~~~~~~~~~~
main.c:17:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | scanf("%c",&c);
| ^~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(void){
int d;
scanf("%d",&d);
char c;
scanf("%c",&c);
while(c=='*' || c=='+'){
int t;
scanf("%d",&t);
if('*'==c){
d=d+t;
} else {
d=d*t;
}
scanf("%c",&c);
}
printf("%d\n",d);
return 0;
}
akakimidori