Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
104466 谭思宸 11计算分段函数的值 C++ Compile Error 0 MS 0 KB 319 2025-01-05 10:35:57

Tests(0/0):


Code:

#include<iostream> #include<cmath> #include<iomanip> using namespace std; int main(){ double x; cin>>x; double y; if(0<=x && x<2){ y=1/(x+1); }else if(2<=x && x<4){ y=x*x; }else{ y=sqrt(x); } cout<<fixed<<setprecision(3)<<y<<endl return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:17:5: error: expected ';' before 'return'
     return 0;
     ^