#include <iostream>
#include <fstream>
#include <string>
using namespace std;
string passwords[10000];
int count = 0;
bool is_common(string password)
{
for (int i = 0; i < count; i++) {
if (password == passwords[i]) {
return true;
}
}
return false;
}
int main()
{
ifstream read("passwords.txt");
while (read >> passwords[count])
{
count++;
}
string password;
cout << "Please enter your password\n";
cin >> password;
if (is_common(password))
{
cout << "It is common\n";
}
else
{
cout << "It is not common\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKI2luY2x1ZGUgPGZzdHJlYW0+CiNpbmNsdWRlIDxzdHJpbmc+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpzdHJpbmcgcGFzc3dvcmRzWzEwMDAwXTsKaW50IGNvdW50ID0gMDsKCmJvb2wgaXNfY29tbW9uKHN0cmluZyBwYXNzd29yZCkKewogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CiAgICAgICAgaWYgKHBhc3N3b3JkID09IHBhc3N3b3Jkc1tpXSkgewogICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gZmFsc2U7Cn0KCmludCBtYWluKCkKewogICAgaWZzdHJlYW0gcmVhZCgicGFzc3dvcmRzLnR4dCIpOwoKICAgIHdoaWxlIChyZWFkID4+IHBhc3N3b3Jkc1tjb3VudF0pCiAgICB7CiAgICAgICAgY291bnQrKzsKICAgIH0KCiAgICBzdHJpbmcgcGFzc3dvcmQ7CiAgICBjb3V0IDw8ICJQbGVhc2UgZW50ZXIgeW91ciBwYXNzd29yZFxuIjsKICAgIGNpbiA+PiBwYXNzd29yZDsKICAgIGlmIChpc19jb21tb24ocGFzc3dvcmQpKQogICAgewogICAgICAgIGNvdXQgPDwgIkl0IGlzIGNvbW1vblxuIjsKICAgIH0KICAgIGVsc2UKICAgIHsKICAgICAgICBjb3V0IDw8ICJJdCBpcyBub3QgY29tbW9uXG4iOwogICAgfQoKICAgIHJldHVybiAwOwp9