3149 Love renaming the small melts 2
http://codevs.cn/problem/3149/
Title Description
Description
There was a man called Wikioi, who liked to change his name.
Now his request has changed, as long as the English letter is his name.
Give you n First name, ask you to judge whether is small melts.
It also reinforces the test data.
Enter a description
Input Description
N
N-row name (all characters)
Output description
Output Description
n rows, yes or no (uppercase)
Sample input
Sample Input
3
&6*14315
Rinkement
Micsloox
Sample output
Sample Output
NO
YES
YES
Data range and Tips
Data Size & Hint
For 40% data n≤10 name length ≤100
For 100% data n≤50 name length ≤100000
#include <iostream>#include<cstdio>#include<cstring>using namespacestd;intN;Chara[100001];intMain () {scanf ("%d",&N); for(intI=1; i<=n;i++) {cin>>A; intlen=strlen (a); BOOLok=true; for(intj=0; j<len;j++) { if(! ((a[j]>='a'&&a[j]<='Z')|| (a[j]>='A'&&a[j]<='Z')) {printf ("no\n"); OK=false; Break; } } if(OK) printf ("yes\n"); }}
Codevs 3165 Love renaming the small melts 2