mirror of https://github.com/me50/kukemuna.git
automated commit by check50 [check50=True]
This commit is contained in:
parent
fdbdadc478
commit
4cc33d7bc1
|
|
@ -32,15 +32,19 @@ int validate_key(string key)
|
||||||
{
|
{
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
for (int i = 0; i < strlen(key); i++)
|
for (char c = 'A'; c <= 'Z'; c++)
|
||||||
{
|
{
|
||||||
if (isalpha(key[i]))
|
for (int i = 0; i < 26; i++)
|
||||||
{
|
{
|
||||||
sum += toupper(key[i]);
|
if (toupper(key[i]) == c)
|
||||||
|
{
|
||||||
|
sum++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sum == 2015) // Sum of 26 unique uppercase characters
|
if (sum == 26) // Sum of 26 unique uppercase characters, but also MMCcEFGHIJKLMNOPQRqTUVWXeZ
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue