結果
問題 |
No.835 ジュース
|
ユーザー |
![]() |
提出日時 | 2019-08-06 20:48:13 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 209 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 14:26:10 |
合計ジャッジ時間 | 483 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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=(double)n*1.5; if(n%2==0){ printf("%d\n",sum); }else{ printf("%d\n",sum-0.5); } return 0; }