题目:

#include <iostream>
#include <string>
 
using namespace std;
 
int GetLen(string& s)
{
	int len = s.size();
	if (len <= 4)
		return 5;
	else if (len >= 5 && len <= 7)
		return 10;
	else
		return 25;
}
 
 
int GetGraph(string& s)
{
	int len = s.size();
	int count = 0;
	int big = 0;
	int small = 0;
	int i = 0;
	int alp = 0;
	while (i<len)
	{
		count++;
		if (isupper(s[i]))
			big++;
		else if (islower(s[i]))
			small++;
 
		if (isalpha(s[i]))
			alp++;
 
		i++;
	}
 
	if (alp == 0)
		return 0;
	else if (small == count || big == count)
		return 10;
 
	if (small > 0 && big > 0)
		return 20;
 
	return 0;
}
 
int GetDig(string& s)
{
	int dig = 0;
	int len = s.size();
	int i = 0;
 
	while (i < len)
	{
		if (isdigit(s[i]))
			dig++;
		i++;
	}
 
	if (dig == 0)
		return 0;
	else if (dig == 1)
		return 10;
	else
		return 20;
}
 
int GetSignal(string& s)
{
	int sig = 0;
	int i = 0;
	int len = s.size();
	while (i < len)
	{
		if (!isdigit(s[i]) && !isalpha(s[i]))
			sig++;
 
		i++;
	}
 
	if (sig == 0)
		return 0;
	else if (sig == 1)
		return 10;
	else
		return 25;
}
 
int GetAward(string& s)
{
	if (GetGraph(s) > 0 && GetDig(s) > 0)
	{
		if (GetSignal(s) > 0)
		{
			if (GetGraph(s) == 20) // 大小写字母  有数字,有符号
				return 5;
 
			return 3; //字母、数字、符号
		}
		return 2; // 字母和数字
	}
	return 0;
}
 
void GetPwdSecurityLevel(string& pPasswordStr)
{
 
	int res1 = GetLen(pPasswordStr);
	int res2 = GetGraph(pPasswordStr);
	int res3 = GetDig(pPasswordStr);
	int res4 = GetSignal(pPasswordStr);
	int res5 = GetAward(pPasswordStr);
 
	int res = res1 + res2 + res3 + res4 + res5;
	if (res >= 90)
		cout << "VERY_SECURE" << endl;
	else if (res >= 80)
		cout << "SECURE" << endl;
	else if (res >= 70)
		cout << "VERY_STRONG" << endl;
	else if (res >= 60)
		cout << "STRONG" << endl;
	else if (res >= 50)
		cout << "AVERAGE" << endl;
	else if (res >= 25)
		cout << "WEAK" << endl;
	else if (res >= 0)
		cout << "VERY_WEAK" << endl;
}
 
int main()
{
	string s;
	while (getline(cin, s))
	{
		GetPwdSecurityLevel(s);
	}
	return 0;
}