Cod sursa(job #143378)

Utilizator stefynr8Space Monkey stefynr8 Data 26 februarie 2008 13:37:55
Problema Algoritmul lui Euclid Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.27 kb
#include <iostream.h>
#include <fstream.h>

void main()

{
 fstream f1("euclid2.in",ios::in);
 fstream f2("euclid2.out",ios::out);


 long a,b,c;



 f1 >> a;
 f1 >> b;

 while(b){
	  c=a%b;
	  a=b;
	  b=c;
	  }
 f2 << a;

 f1.close();
 f2.close();
}