View Code of Problem 80

#include<stdio.h>
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF&&n>0)
	{
		int last=0,i;
		for(i=2;i<=n;i++)
			last=(last+3)%i;
		printf("%d\n",last+1);	
	}	
} 

Double click to view unformatted code.


Back to problem 80