View Code of Problem 80

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

Double click to view unformatted code.


Back to problem 80