Switch Game HDU - 2053

水蛙族的希望°發表於2020-11-14

Switch Game HDU - 2053

開關燈問題

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	while(cin >> n)
	{
		int cnt = 0;
		for(int i = 1; i <= n; i++)
			if(n % i == 0)
				cnt++;
		cnt & 1 ? cout << "1" << endl : cout << "0" << endl;
	}
	return 0;
}