Cod sursa(job #249228)
Utilizator | Data | 27 ianuarie 2009 21:33:22 | |
---|---|---|---|
Problema | Multiplu | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<iostream.h>
#include<fstream.h>
#include<stdlib.h>
#include<stdio.h>
int main()
{ int a,b,x,ok=0,n=0;
char *p;
fstream f("multiplu.in",ios::in);
f>>a; f>>b;
f.close();
while(ok==0)
{ n++;
x=n;
itoa(x,p,2);
x=atoi(p);
if(x%a==0&&x%b==0)
ok=1; }
fstream g("multiplu.out",ios::out);
g<<x;
return 0; }