pass
user_5811307
plain_text
2 years ago
2.1 kB
4
Indexable
#include <iostream>
using namespace std;
int main()
{
int a =0;
string c;
cin >> c;
int cnt = 0;
int leng = c.length();
int x1 =0, x2 =0, x3 =0, x4 =0;
//cout << leng<< endl;
for (int i =0; i <c.length(); i++)
{
switch(c[i]){
case '!' ... '~':
a++;
break;
default:
cout << "NO"<< endl;
return 0;
}
}
switch(c.length()){
case 8 ... 14:
a++;
break;
default:
cout << "NO"<< endl;
return 0;
}
for (int i =0; i <c.length(); i++)
{
switch(c[i]){
case 'A' ... 'Z':
//i = leng;
x1 = 1;
break;
default:
break;
}
switch(c[i]){
case 'a' ... 'z':
//i = leng;
x2 = 1;
break;
default:
break;
}
switch(c[i]){
case '0' ... '9':
//i = leng;
x3 = 1;
break;
default:
break;
}
}
for (int i =0; i <c.length(); i++)
{
switch(c[i]){
case '{' ... '~':
i = leng;
x4 =1;
break;
case '[' ... '\'': // ' - вопрос
i = leng;
x4 =1;
break;
case ':' ... '@':
i = leng;
x4 =1;
break;
case '!' ... '/':
i = leng;
x4 =1;
break;
default:
break;
}
}
//cout << x1 + x2 + x3 +x4;
if( x1 + x2 + x3 +x4 >= 3 ){
cout << "YES" << endl;
}
else
cout << "NO" << endl;
}
Editor is loading...