View Code of Problem 80

#include <stdio.h> 
int main() 
{
    int n, s = 0,M = 3,i; 
    while(scanf("%d", &n)!=EOF)
	{
		s = 0
		if(n==0)
		break;
		
		
		
		for (i = 2; i <= n; ++i) 
		s = (s+M)%i; 
		printf("%d\n", s+1);
	}
	return 0;
}
/*
Main.c: In function 'main':
Main.c:8:3: error: expected ';' before 'if'
   if(n==0)
   ^
*/

Double click to view unformatted code.


Back to problem 80