5 solutions
-
0
#include<bits/stdc++.h> using namespace std; string s,str; int b[5]; int main() { cin>>str; str+=','; for(int i=0;i<str.length();i++){ if(str[i]!=','){ s+=str[i]; continue; } b[4]=1; int A=s.length(); if(A<=12 && A>=6){ for(int j=0;j<A;j++){ if(s[j]<='Z' && s[j]>='A') b[1]=1; else if(s[j]<='z' && s[j]>='a') b[0]=1; else if(s[j]=='!' || s[j]=='@' || s[j]=='#' || s[j]=='$') b[3]=1; else if(s[j]>='0' && s[j]<='9') b[2]=1; else if(!(s[j]=='!' || s[j]=='@' || s[j]=='#' || s[j]=='$')) b[4]=0; } if(b[0]+b[1]+b[2]>=2 && b[3]==1 && b[4]==1){ cout<<s<<endl; } } b[0]=b[1]=b[2]=b[3]=0; s=""; } return 0; }
Information
- ID
- 1179
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- # Submissions
- 57
- Accepted
- 15
- Uploaded By