Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
97193 罗子童 字符串长度判断 C++ Compile Error 0 MS 0 KB 643 2024-11-10 18:28:45

Tests(0/0):


Code:

#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 n[151],a[151]; int s1=0,s2=0; cin>>n>>a; for(int i=0;i<=150;i++){ if(n[i]='\0'){ s1=i; break; } } for(int i=0;i<=150;i++){ if(a[i]='\0'){ s2=i; break; } } if(s1=s2){ cout<<"yes" } else{ cout<<"no" } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:21: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
         if(n[i]='\0'){
                     ^
Main.cc:19:21: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
         if(a[i]='\0'){
                     ^
Main.cc:24:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
     if(s1=s2){
             ^
Main.cc:26:5: error: expected ';' before '}' token
     }
     ^
Main.cc:29:5: error: expected ';' before '}' token
     }
     ^