結果
| 問題 |
No.56 消費税
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-03 12:00:41 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 420 bytes |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 26,496 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-03-03 12:00:54 |
| 合計ジャッジ時間 | 1,305 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 13 WA * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:14:22: warning: implicit declaration of function ‘floor’ [-Wimplicit-function-declaration]
14 | double sum = floor(a * tax);
| ^~~~~
main.c:2:1: note: include ‘<math.h>’ or provide a declaration of ‘floor’
1 | #include <stdio.h>
+++ |+#include <math.h>
2 |
main.c:14:22: warning: incompatible implicit declaration of built-in function ‘floor’ [-Wbuiltin-declaration-mismatch]
14 | double sum = floor(a * tax);
| ^~~~~
main.c:14:22: note: include ‘<math.h>’ or provide a declaration of ‘floor’
ソースコード
#include <stdio.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 = floor(a * tax);
//printf("消費税分:%fユキコダ\n",tax);
//printf("税込み金額:%1.fユキコダ\n",sum);
printf("%.0f\n",sum);
}
Maeda