View Code of Problem 80

#include<bits/stdc++.h>
using namespace std;

vector<int>l;
int main() {
	int n;
	while (cin >> n) {
		if (n == 0) {
			break;
		}
		int num = 0;
		for (int i = 1; i <= n; i++) {
			num = (num + 3) % i;
			
		}
		cout << num + 1 <<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 80