Code
#include<bits/stdc++.h>
#include <ctype.h>
using namespace std;
int main()
{
int p,n,N;
cin>>N;
while(N--) {
string a;
bool l = false;
bool u = false;
bool d = false;
bool s = false;
cin >> a;
if(a.size()<8)
cout<<"invalid"<<endl;
else{
for (char c : a)
{
if (islower(c)) {
l = true;
} else if (isupper(c)) {
u = true;
} else if (isdigit(c)) {
d = true;
} if (ispunct(c)){
s=true;}
}
if(!l || !u || !d || !s)
cout<<"invalid"<<endl;
else
cout<<"valid"<<endl;
}
}}
Information
- Submit By
- Type
- Submission
- Problem
- P1007 Password Checker
- Contest
- Beta Round #1
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2023-11-29 16:48:25
- Judged At
- 2024-11-11 03:50:50
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 376.0 KiB