Salut,am scris programul ,dar ni functioneaza:( cineva pot sa ajut ,pentru ca nu stiu ce este problema ?
#include <fstream>
#include "stdio.h"
using namespace std;
int lnko(int z,int y)
{
int tmp;
if (z<0) z= -z;
if (y<0) y= -y;
while(y > 0) {
tmp = y;
z = z % y;
z = tmp;
}
return z;
}
int main()
{
ifstream f("cmmdc.in");
ofstream g("cmmdc.out");
int a,b,e;
f >> a >> b;
e = lnko (a,b);
if (e>30000)
return 0;
else{
g << e << '\n';
g.close();
return 0;
}}