Pagini recente » Cod sursa (job #3250261) | Cod sursa (job #2685627) | Cod sursa (job #534992) | Cod sursa (job #1172640) | Cod sursa (job #671694)
Cod sursa(job #671694)
#include <fstream>
#include <cstdlib>
using namespace std;
typedef unsigned int uint;
inline uint gcd( uint x, uint y )
{
if( !y )
return x;
return gcd( y, x%y );
}
int main( void )
{
uint T, x, y;
ifstream in( "euclid2.in" );
ofstream out( "euclid2.out" );
for( in>>T; T; --T )
{
in>>x>>y;
out<<gcd( x, y )<<'\n';
}
return EXIT_SUCCESS;
}