标签:
1 5
1 0Consider the second test case: The initial condition : 0 0 0 0 0 … After the first operation : 1 1 1 1 1 … After the second operation : 1 0 1 0 1 … After the third operation : 1 0 0 0 1 … After the fourth operation : 1 0 0 1 1 … After the fifth operation : 1 0 0 1 0 … The later operations cannot change the condition of the fifth lamp any more. So the answer is 0.Hinthint
#include <iostream> using namespace std; int main() { int n; while (cin >> n) { int num=0; for (int i=1; i<=n; i++) { if (n %i ==0) num++; } if (num%2 == 0) cout << 0; else cout << 1; cout <<endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/mengfanrong/p/5030742.html