Code
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
void solve(){
string s;
cin>>s;
int chr = s.size();
int l = 0, u = 0, d = 0, sp = 0;
for(int i=0;i<chr;i++){
if(s[i]>=97 && s[i]<=122){
l++;
}
else if(s[i]>=65 && s[i]<=90){
u++;
}
else if(s[i]>=48 && s[i]<=57){
d++;
}
else{
sp++;
}
}
if(chr>=8 && l>=1 && u>=1 && d>=1 && sp>=1){
cout<<"valid"<<endl;
}
else{
cout<<"invalid"<<endl;
}
}
int main(){
int test;
cin>>test;
while(test--){
solve();
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1007 Password Checker
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2023-12-31 13:54:48
- Judged At
- 2024-11-11 03:46:32
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 332.0 KiB