Search found 1 match

by nb2.ruet
Sat Nov 06, 2010 6:52 pm
Forum: Volume 101 (10100-10199)
Topic: 10110 - Light, more light
Replies: 76
Views: 39769

Re: 10110 - Light, More Light

how ican avoid time limit exit ?any one help me please.......... :oops:

#include<stdio.h>

long int n,i,k=0;
int main()
{

while (1)
{
k=0;
scanf("%d",&n);
if (n==0)
break;
for (i=1;i<=n;i++)
{
if (n%i==0)
k++;
}
if (k%2==0)
printf("no\n");
else
printf("yes\n");
}
return 0;
}

Go to advanced search