View Code of Problem 80

#include <iostream>
using namespace std;
const int m = 3;
int main()
{
    int n, f = 0;
    while(cin >> n&&n!=0){
    	for (int i = 1; i <= n; i++) 
			f = (f + m) % i;
    	cout << f + 1 << endl;
	}
   
}

Double click to view unformatted code.


Back to problem 80