1 条题解
-
1
#include<bits/stdc++.h> using namespace std; int main(){ bool ok=true; string s; cin>>s; char a=s[0]; if(!((a>='A'&&a<='Z')||(a>='a'&&a<='z')||a=='_')) ok=false; for(int i=1;ok&&i<s.length();i++){ char c=s[i]; bool L=(c>='A'&&c<='Z')||(c>='a'&&c<='z'); bool D=(c>='0'&&c<='9'); bool U=(c=='_'); if(!(L||D||U)) ok=false; } if(ok) cout<<"yes"; else cout<<"no"; return 0; }
信息
- ID
- 11898
- 时间
- 1000ms
- 内存
- 512MiB
- 难度
- 1
- 标签
- 递交数
- 7
- 已通过
- 4
- 上传者