Cod sursa(job #215616)

Utilizator ooctavTuchila Octavian ooctav Data 19 octombrie 2008 18:56:34
Problema Next Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<stdio.h>
int main()
{
    int n,d,m;
    FILE *f1,f2;
    f1=fopen("next.in","r");
    f2=fopen("next.out","w");
    fscanf(f1,"%d%d",&n,&d);
    m=n;
    while(m%d!=0){
                  m=m+1
                  };
    fprintf(f2,"%d",m);
    fclose(f1);
    fclose(f2);
    return 0;
}