0
点赞
收藏
分享

微信扫一扫

1081 检查密码 (15 分)

不会弹吉他的二郎腿 2022-02-05 阅读 84
c++
#include<iostream>
#include<cctype>
using namespace std;
int main(){
	int n;
	string s;
	cin>>n;
	getchar();
	for(int i=0;i<n;i++){
		getline(cin,s);
		int alp=0,num=0,d=0,oth=0;
		for(int j=0;j<s.length();j++){
			if(isalpha(s[j]))alp++;
			else if(isdigit(s[j]))num++;
			else if(s[j]=='.')d++;
			else oth++;
		}
		if(s.length()>=6&&alp!=0&&num!=0&&oth==0)
			cout<<"Your password is wan mei."<<endl;
		else if(s.length()<6)
			cout<<"Your password is tai duan le."<<endl;
		else if(oth!=0)
			cout<<"Your password is tai luan le."<<endl;
		else if(num==0)
			cout<<"Your password needs shu zi."<<endl;
		else if(alp==0)
			cout<<"Your password needs zi mu."<<endl;
	}
    return 0;
}

 

举报

相关推荐

0 条评论