Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123255 周民苡 合法的标识符 C++ Compile Error 0 MS 0 KB 625 2025-06-28 16:16:47

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(){ string a; cin>>a; int a1=a.length; if(a[0]<='9'&&a[0]>='0'){ cout<<"no"<<endl; return 0; } for(int i;i<a1;i++){ cher b=a[i]; if(!((b<='9'&&b>='0')||(b<='Z'&&b>='A')||(b<='z'&&b>='a')||(b=='_'))){ cout<<'no'<<endl; } return 0; } cout<<'yes'<<endl; return 0; }


Run Info:

Main.cc:18:19: warning: multi-character character constant [-Wmultichar]
             cout<<'no'<::length, std::allocator >' from type 'std::__cxx11::basic_string::size_type (std::__cxx11::basic_string::)() const noexcept {aka long unsigned int (std::__cxx11::basic_string::)() const noexcept}' to type 'int'
     int a1=a.length;
              ^
Main.cc:16:8: error: 'cher' was not declared in this scope
        cher b=a[i];
        ^
Main.cc:17:15: error: 'b' was not declared in this scope
         if(!((b<='9'&&b>='0')||(b<='Z'&&b>='A')||(b<='z'&&b>='a')||(b=='_'))){
               ^