60pts求调
查看原帖
60pts求调
1360496
NullPointerExpection楼主2024/8/10 22:21
#include <bits/stdc++.h>
using namespace std;

int t;
long long n;
int main() {
	cin >> t;
	while(t--) {
		bool ok = false;
		cin >> n;
		long long temp = n;
		int a[19], tail = 0;
		while(temp) {
			a[tail++] = temp % 10;
			temp /= 10;
		}
		reverse(a, a + tail);
		if(!(a[0] % 4) || !(a[tail - 1] % 4))
			ok = true;
		for(int i = 0; i < tail; i++) {
			if(!((a[i] * 10 + a[i + 1]) % 4) || !((a[i] * 10 + a[tail - 1]) % 4)) {
				ok = true;
				break;
			}
		}
		cout << (ok ? "Yes\n" : "No\n");
	}
	return 0;
}
2024/8/10 22:21
加载中...