Pagini recente » Cod sursa (job #1366393) | Cod sursa (job #1364243) | Cod sursa (job #2085337) | Diferente pentru problema/tequila intre reviziile 78 si 79 | Cod sursa (job #1594085)
#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
int i,j,k,aux,y,x,ok=0;
ifstream fin("fractii.in");
fin>>n;
fin.close();
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
k=1;
x=i;y=j;
while(k==1)
if(!y) k=0;
else
{
aux=x;
x=y;
y=aux%y;
}
if(x<=1) {ok++;}
}
ofstream fout("fractii.out");
fout<<ok;
fout.close();
return 0;
}