Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3667 孙浚轩 合法的标识符 C++ Wrong Answer 0 MS 264 KB 432 2024-06-22 17:08:24

Tests(1/10):


Code:

#include<iostream> using namespace std; bool islegitimate(string s){ if(s[0]>='0'&&s[0]<='9') return 0; int lens=s.size(); for(int i=0;i<lens;i++){ if(s[i]>='A'&&s[i]<='Z'||s[i]>='a'&&s[i]<='z'||s[i]>='0'&&s[i]<='9'||s[i]=='_') continue; else return 0; } return 1; } int main(){ string s; cin>>s; if(islegitimate) cout<<"yes"; else cout<<"no"; return 0; }


Run Info:

------Input------
a_b!d
------Answer-----
no
------Your output-----
yes