牛客 99287. 小R排数字
原题链接
简单
#include <bits/stdc++.h>
using namespace std;
const int N = 15;
int path[N];
int cnt;
bool st;
int main()
{
int n;
cin >> n;
while (n -- )
{
int t;
cin >> t;
cnt = 0;
while (t)
{
path[cnt ++ ] = t % 10;
t /= 10;
}
st = false;
if (cnt == 1)
{
if (path[0] % 4 == 0) st = true;
}
else
{
for (int i = 0; i < cnt && !st; i ++ )
{
int j = 0;
while (j < cnt)
{
if (j != i && (path[i] * 10 + path[j]) % 4 == 0)
{
st = true;
break;
}
else j ++ ;
}
}
}
if (st) puts("YES");
else puts("NO");
}
return 0;
}