View Code of Problem 80

#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stdio.h>
#include<string.h>
#include<cmath>
using namespace std;
int main()
{
    int n;
    while(scanf("%d",&n),n)
    {
       int m=0;
       for(int i=2;i<=n;i++)
        m=(m+3)%i;
       cout<<m+1<<endl;
    }
   return 0;
}

Double click to view unformatted code.


Back to problem 80