Cod sursa(job #2056801)

Utilizator teodor440Teodor Tonghioiu teodor440 Data 4 noiembrie 2017 13:19:25
Problema Algoritmul lui Euclid Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.55 kb
#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <fstream>
#include <set>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <stack>
#include <string.h>
#include <stdio.h>
#include <limits.h>

using namespace std;

ifstream f("euclid2.in");
ofstream g("euclid2.out");

int cmmdc(int a, int b){
    int c;
    while(b > 0){
        c = b;
        b = a % b;
        a = c;
    }
    return a;
}

int main()
{
    int i, j;
    f >> i >> j;
    g << cmmdc(i, j);

    return 0;
}