Cod sursa(job #241361)

Utilizator mathboyDragos-Alin Rotaru mathboy Data 9 ianuarie 2009 21:56:00
Problema Algoritmul lui Euclid Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.2 kb
#include <fstream.h>
ifstream f("euclid2.in");
ofstream g("euclid2.out");
void main()
{
int a,b,c,T,i;f>>T;
for(i=1;i<=T;i++) {f>>a>>b;
while(b) { c=a%b;
	a=b;
	b=c;
	}g<<a<<endl;}


}