else 不能直接跟条件 把它改成else if(x<0)或 把(x<0)删掉
2x是数学表示,C++可不支持,你要 写2 *x
#include using namespace std;int main(){ double x,y; cin>>x; if (x>=-0.0000001) { y = x+1; } else y = 2*x-3; cout< system("pause"); return 0;}