Cod sursa(job #1206933)
| Utilizator | Data | 11 iulie 2014 15:45:47 | |
|---|---|---|---|
| Problema | Ciurul lui Eratosthenes | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.32 kb |
#include <fstream>
using namespace std;
ifstream f("cmmdc.in");
ofstream g("cmmdc.out");
long long aux,a,b,r;
int main()
{
f>>a>>b;
if(a<b)
{
aux=b;
b=a;
a=aux;
}
r=a%b;
while(r)
{
a=b;
b=r;
r=a%b;
}
if(b==1) b=0;
g<<b<<'\n';
return 0;
}
