Chef buys a lottery ticket that has a 3 digit code associated with it. He thinks that digit 7 is his lucky digit and brings him good luck. Chef will win some amount in the lottery if at least one of the digits of the lottery ticket is 7. Given three digits A, B, and C of the lottery ticket, tell whether Chef wins something or not
#include <iostream>
using namespace std;
// 3 7 234
int main()
{
int A, B,C, t;
cin >> t;
while (t--)
{
int flag = 0;
cin >> A;
cin >> B;
cin >> C;
if (A == 7 || B == 7 || C == 7)
{
flag = 1;
}
if (flag == 1)
{
cout << "YES" << endl;
}
else
cout << "NO" << endl;
}
}