View Code of Problem 31

#include<stdio.h>
#include<math.h>
int main()
{
int j,m;
long long int i;
int a[1000];
j=1;
while(i<100000)
{if((i%3==2)&&(i%5==3)&&(i%7==2))
a[j++]=i;
++i;
}	
while(scanf("%d",&m)!=EOF&&m>=1)
{
 
	printf("%ld\n",a[m]);
}
 
return 0;
}

Double click to view unformatted code.


Back to problem 31