View Code of Problem 3495

#include <stdio.h>

int mod(int n,int m){
	while(n>=m){
		n=n-m;
	}
	return n;
}

int main(){
	int a,b;
	while(scanf("%d %d",&a,&b)!=EOF){
		int result = mod(a,b);
		printf("%d\n",result);
	}
}

Double click to view unformatted code.


Back to problem 3495