結果
| 問題 |
No.56 消費税
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-03 13:08:31 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 495 bytes |
| コンパイル時間 | 465 ms |
| コンパイル使用メモリ | 28,416 KB |
| 実行使用メモリ | 8,608 KB |
| 最終ジャッジ日時 | 2025-03-03 13:08:33 |
| 合計ジャッジ時間 | 1,537 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 23 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:19:19: warning: format ‘%lf’ expects argument of type ‘double’, but argument 2 has type ‘long double’ [-Wformat=]
19 | printf("%lf\n",floorl(sum));
| ~~^ ~~~~~~~~~~~
| | |
| | long double
| double
| %Lf
ソースコード
#include <stdio.h>
#include <math.h>
void main(void){
double a = 0 , b = 0;
int inputA = scanf("%le",&a);
if(inputA == 2){
printf("Aの入力エラー\n");
}
int inputB = scanf("%le\n",&b);
if(inputB == 2){
printf("Bの入力エラー\n");
}
double tax = b/100 + 1;
double sum = a * tax;
//printf("消費税分:%fユキコダ\n",tax);
//printf("税込み金額:%fユキコダ\n",a * tax);
//printf("税込み金額:%0.fユキコダ\n",sum);
printf("%lf\n",floorl(sum));
}
Maeda