Cod sursa(job #223087)

Utilizator drag0s93Mandu Dragos drag0s93 Data 26 noiembrie 2008 21:36:51
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<stdio.h>

using namespace std;

int main()
{
	int N,M,D,cm=0,ok=0;
	freopen("next.in","r",stdin);
	freopen("next.out","w",stdout);
	scanf("%d%d",&N,&D);
	M=N;
	while(ok==0)
	{
		if(M%D==0)
		{
			printf("%d",M);
		    ok=1;
		}
		else ok=0;
		cm=M;
		if(ok==0)
			M++;
		
	}
	return 0;
}