Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
103461 | 欧阳俊懿 | 字符串长度判断 | C++ | Compile Error | 0 MS | 0 KB | 494 | 2024-12-28 17:15:38 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char a[1001],b[1001]; int sum1=0,sum2=0; cin>>a>>b; while(a[sum1]!="/0") sum1++; while(a[sum2]!="/0") sum2++; if(sum1==sum2) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }
Main.cc: In function 'int main()': Main.cc:11:20: warning: comparison with string literal results in unspecified behaviour [-Waddress] while(a[sum1]!="/0") ^ Main.cc:11:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] Main.cc:13:20: warning: comparison with string literal results in unspecified behaviour [-Waddress] while(a[sum2]!="/0") ^ Main.cc:13:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]