Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3030 | 杨洋杰 | 04保留两位小数 | C++ | Compile Error | 0 MS | 0 KB | 191 | 2024-03-16 21:38:28 |
#include<iostream> #include<cmath> #include<iomanip> using namespace std; int main(){ double a,b; scanf("%d",&a,&b); cout<<fixed<<setprocision(2)<<a/b<<endl; return 0; }
Main.cc: In function 'int main()': Main.cc:7:18: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'double*' [-Wformat=] scanf("%d",&a,&b); ^ Main.cc:7:18: warning: too many arguments for format [-Wformat-extra-args] Main.cc:8:32: error: 'setprocision' was not declared in this scope cout<fixed<<setprocision(2)<<a/b<<endl; ^