Search
 
SCRIPT & CODE EXAMPLE
 

CPP

Password codechef solution in c++

#include<iostream>
#define ll long long
#include<vector>
#include<climits>
#include<string>
#include<algorithm>
using namespace std;

void solve()
{
	string pass;
	cin >> pass;
	if (pass.length() < 10)
	{
		cout << "NO
";
	}
	else
	{
		ll l, u, d, sp;
		l = u = d = sp = 0;
		for (ll i = 0; i < pass.length(); i++)
		{
			if (pass[i] >= 97 && pass[i] <= 122)
			{
				l++;
			}
			if (i > 0 && i < pass.length() - 1)
			{
				if (pass[i] >= '0' && pass[i] <= '9')
					d++;
				if (pass[i] >= 65 && pass[i] <= 90)
					u++;
				if (pass[i] == '@' || pass[i] == '#' || pass[i] == '%' || pass[i] == '&' || pass[i] == '?')
					sp++;
			}
		}
		if (l > 0 && u > 0 && d > 0 && sp > 0)
		{
			cout << "YES
";
		}
		else
		{
			cout << "NO
";
		}
	}
}

int main()
{

	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	
	return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: dinamic 
Cpp :: c++ iterator shorthand 
Cpp :: Check whether K-th bit is set or not c++ 
Cpp :: Create an algorithm to identify what is the next largest element on a stack (using stack/queue operations only) INPUT: [ 10, 3, 1, 14, 15, 5 ] OUTPUT: 10 - 14 3 - 14 1 - 14 14 - 15 15 - -1 5 - -1 
Cpp :: how to save system function output into a variable in c++ 
Cpp :: cpp class access array member by different name 
Cpp :: powershell script query mssql windows authentication 
Cpp :: && in cpp 
Cpp :: a suprise... c++ 
Cpp :: product of array in cpp 
Cpp :: rgb(100,100,100,0.5) validation c++ 
Cpp :: Use of Scope Resolution operator for namespace 
Cpp :: traverse string in cpp 
Cpp :: max in c++ with three elements 
Cpp :: 400 watt hour per kg 
Cpp :: Diamond pattren program in C++ 
Cpp :: how to get steam id c++ 
Cpp :: online compiler c++ with big O calculatorhttps://www.codegrepper.com/code-examples/cpp/how+to+convert+string+to+wchar_t+in+c%2B%2B 
Cpp :: qt unhandled exception handler 
Cpp :: what are manipulators in c++ 
Cpp :: generate consecutive numbers at compile time 
Cpp :: c++ ignore_line 
Cpp :: boost filesystem get filename without exetention from path 
Cpp :: yearly interest calculator c++ using for loop 
Cpp :: c++ operators 
Cpp :: Magical Doors codechef solution in c++ 
Cpp :: frac{2}{5}MR^2 typed in c++ 
Cpp :: gcd of two number in c++ stl 
Cpp :: hello command not printing in c++ 
Cpp :: Casino Number Guessing Game - C++ 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =