View Code of Problem 80

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

Double click to view unformatted code.


Back to problem 80