View Code of Problem 80

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

Double click to view unformatted code.


Back to problem 80