結果
| 問題 |
No.835 ジュース
|
| コンテスト | |
| ユーザー |
Kakisuke
|
| 提出日時 | 2019-08-06 20:47:06 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 208 bytes |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 21,376 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 14:26:09 |
| 合計ジャッジ時間 | 575 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=]
9 | printf("%d\n",sum);
| ~^ ~~~
| | |
| int double
| %f
main.c:11:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=]
11 | printf("%d\n",sum-0.5);
| ~^ ~~~~~~~
| | |
| int double
| %f
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=n*1.5;
if((int)sum%1==0){
printf("%d\n",sum);
}else{
printf("%d\n",sum-0.5);
}
return 0;
}
Kakisuke