View Code of Problem 80

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

        }
        printf("%d\n",a+1);
    }
}

Double click to view unformatted code.


Back to problem 80