View Code of Problem 80

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

Double click to view unformatted code.


Back to problem 80