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>
#include <cstring>
using namespace std;
int main()
{
int n;
int count;
while(cin>>n)
{
count=0;
for(int i=1;i<=n;i++)
{
if(n%i==0)
{
count++;
}
}
if(count%2==0)cout<<"0"<<endl;
else cout<<"1"<<endl;
}
return 0;
}原文:http://www.cnblogs.com/blfbuaa/p/6995170.html