[ create a new paste ] login | about

Link: http://codepad.org/EYtiKWt1    [ raw code | output | fork ]

C, pasted on Dec 8:
#include <stdio.h>
 main()
{int a[101],b[101];
int i,p,count;
for(i=1;i<=100;i++)
{a[i]=i;b[i]=1;}
i=1;count=100;
while(count!=1)
{  p=0;
while(b[i]==1)
{p++;
 if(p==3)
   {
b[i]=0;
p=0;
count--;
   }
i++;
if(i==101)   i=1;
}
}
for(i=1;i<=100;i++)
if(b[i]==1)   printf("%d",i);
}


Output:
1
Timeout


Create a new paste based on this one


Comments: