1081 检查密码 (15 分)

#include 
#include 

using namespace std;

int main() {
	int n;
	cin>>n;
	getchar();
	while(n--){
		string s;
		getline(cin,s);
		int numN=0,numS=0,f=0;
		if(s.length()<6){
			cout<<"Your password is tai duan le."<<"\n";
		}else{
			for(int i=0,len=s.length();i='0'){
					numN++;
				}else if((s[i]<='z'&&s[i]>='a')||(s[i]<='Z'&&s[i]>='A')){
					numS++;
				}else if(s[i]=='.'){
				}else{
					cout<<"Your password is tai luan le."<<"\n";
					f=1;
					break;
				}
			}
			if(f==0){
				if(numN==0){
					cout<<"Your password needs shu zi."<<"\n";
				}else if(numS==0){
					cout<<"Your password needs zi mu."<<"\n";
				}else{
					cout<<"Your password is wan mei."<<"\n";
				}
			}
		}
	}
	return 0;
}

 

你可能感兴趣的:(PATBasic)