Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
162 | ZRH | 【基础题】绝对值 | C++ | Compile Error | 0 MS | 0 KB | 385 | 2022-07-21 10:34:04 |
#include<iostream> //输入函数库 #include<iomanip> #include<cmath> //数学函数库 #include<cstdio> #include<ctime> #include<cstring> #include<cstdlib> #include<string> #include<stdlib.h> #include<sys/time.h> using namespace std; int main(){ double x; cin>>x; if(x>=0){ printf("%.2lf,x"); } else{ x=0-x; printf("%.2lf,x") } return 0; }
Main.cc: In function 'int main()': Main.cc:17:19: warning: format '%lf' expects a matching 'double' argument [-Wformat=] printf("%.2lf,x"); ^ Main.cc:21:19: warning: format '%lf' expects a matching 'double' argument [-Wformat=] printf("%.2lf,x") ^ Main.cc:22:2: error: expected ';' before '}' token } ^