結果
| 問題 |
No.835 ジュース
|
| コンテスト | |
| ユーザー |
Kakisuke
|
| 提出日時 | 2019-08-06 20:49:07 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 213 bytes |
| コンパイル時間 | 72 ms |
| コンパイル使用メモリ | 21,248 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-18 14:26:10 |
| 合計ジャッジ時間 | 474 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:20: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=]
9 | printf("%.0d\n",sum);
| ~~~^ ~~~
| | |
| int double
| %.0f
main.c:11:20: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=]
11 | printf("%.0d\n",sum-0.5);
| ~~~^ ~~~~~~~
| | |
| int double
| %.0f
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main()
{
int n;
double sum;
scanf("%d",&n);
sum=(double)n*1.5;
if(n%2==0){
printf("%.0d\n",sum);
}else{
printf("%.0d\n",sum-0.5);
}
return 0;
}
Kakisuke