Cod sursa(job #2194872)

Utilizator soonrobertKovacs Robert soonrobert Data 14 aprilie 2018 15:28:11
Problema Algoritmul lui Euclid Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.3 kb
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    ifstream be("euclid2.in");
    ofstream ki("euclid2.out");
    int a,b;
    be>>a>>b;
    while (a!=b)
    {
        if (a > b)
            a %= b;
        else
            b %= a;
    }
    ki<<a;
    return 0;
}