| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 66545 | 石依灵 | 11计算分段函数的值 | C++ | Compile Error | 0 MS | 0 KB | 310 | 2024-03-09 13:26:39 |
# include<iostream> # include<cstdio> using namespace std; int main(){ double x,y; scanf("%2lf",&x); if(0<=x && x<5){ y=-x+2.5; } if(5<=x && x<10){ y=2-1.5*(x-3)*2; } if(10<=x && <20){ y=x/2-1.5; } printf("%3.lf",y); return 0; }
Main.cc: In function 'int main()':
Main.cc:13:17: error: expected primary-expression before '<' token
if(10<=x && <20){
^
Main.cc:6:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%2lf",&x);
^