Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
144979 c13 09计算算数表达式 C++ Compile Error 0 MS 0 KB 270 2026-01-24 19:54:39

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a,c; char b; scnaf("%d %s %d",&a,&b,&c) if(b=='+')cout<<a+b<<endl; else if(b=='-')cout<<a-b<<endl; else if(b=='*')cout<<a*b<<endl; else if(b=='/')cout<<a/b<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:30: error: 'scnaf' was not declared in this scope
     scnaf("%d %s %d",&a,&b,&c)
                              ^
Main.cc:8:5: error: 'else' without a previous 'if'
     else if(b=='-')cout<