1、就是考察一下cctype的运用,注意第一个应该是isprint,只要是可打印字符都行,而不是isalpha(代表字母)。
#include<cstdio>
#include<string>
#include<iostream>
#include<cctype>
using namespace std;
int main(){
string s;
cin>>s;
int a=0,b=0,c=0,d=0;
for(int i=0;i<s.length();i++){
if(isprint(s[i])) a++;
if(isupper(s[i])) b++;
if(islower(s[i])) c++;
if(isdigit(s[i])) d++;
}
if(a>=5&&b>=1&&c>=1&&d>=1) printf("Correct\n");
else printf("Too weak\n");
return 0;
}