結果
| 問題 | No.835 ジュース |
| コンテスト | |
| ユーザー |
Kakisuke
|
| 提出日時 | 2019-08-06 20:45:48 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 212 bytes |
| コンパイル時間 | 210 ms |
| コンパイル使用メモリ | 21,120 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-18 14:26:08 |
| 合計ジャッジ時間 | 605 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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/1);
| ~^ ~~~~~
| | |
| 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/1-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/1);
}else{
printf("%d\n",sum/1-0.5);
}
return 0;
}
Kakisuke