結果
| 問題 |
No.285 消費税2
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2022-07-23 04:54:45 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 2,000 ms |
| コード長 | 310 bytes |
| コンパイル時間 | 1,839 ms |
| コンパイル使用メモリ | 191,112 KB |
| 最終ジャッジ日時 | 2025-01-30 13:12:40 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:15:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘ll’ {aka ‘long long int’} [-Wformat=]
15 | printf("%ld.",d/100);
| ~~^ ~~~~~
| | |
| | ll {aka long long int}
| long int
| %lld
main.cpp:16:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ll’ {aka ‘long long int’} [-Wformat=]
16 | printf("%02d\n",d%100);
| ~~~^ ~~~~~
| | |
| int ll {aka long long int}
| %02lld
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll d;
cin>>d;
d*=108;
printf("%ld.",d/100);
printf("%02d\n",d%100);
return 0;
}
umezo