Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6198 | 郑元泰 | 字符串长度判断 | C++ | Compile Error | 0 MS | 0 KB | 361 | 2025-01-13 15:39:51 |
# include<iostream> using namespace std; int main(){ char s1[151],s2[151]; cin>>s1>>s2; int s1_num=0;//存储s1的长度和s2的长度 int i=0; while(s1[1]!='\0'){ s1_num++; i++; } i=0; while(s2[i]!='\0'){ s2_num++; i++; } cout<<s1_num<<" "<<s2_num<<endl; return 0; }
Main.cc: In function 'int main()': Main.cc:14:9: error: 's2_num' was not declared in this scope s2_num++; ^ Main.cc:17:24: error: 's2_num' was not declared in this scope cout<s1_num<<" "<<s2_num<<endl; ^