View Code of Problem 80

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

	}
	return 0;
}

Double click to view unformatted code.


Back to problem 80