Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2690 张宸瑜 字符串相等判断 C++ Compile Error 0 MS 0 KB 411 2024-01-20 17:43:26

Tests(0/0):


Code:

# include<iostream> # include<cstdio> # include<iomanip> # include<iostream> # include<string> using namespace std; int main(){ //strca(s1,s2)把s2接在s1后面 //strcpy(s1,s2)将s2赋值给s2 //strcmp(s1,s2)将s1跟s2比较 char s1[1000],s2[1000]; cin>>s1>>s2 if(strcmp(s1,s2)==0){ cout<<"yes"; } else { cout<<"no"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:5: error: expected ';' before 'if'
     if(strcmp(s1,s2)==0){
     ^
Main.cc:16:5: error: 'else' without a previous 'if'
     else
     ^