Cod sursa(job #2701384)

Utilizator Apyxabcdefghij Apyx Data 30 ianuarie 2021 18:52:15
Problema Fractii Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("fractii.in");
ofstream fout("fractii.out");

int main()
{
    int n, nr = 0;
    fin >> n;
    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= n; j++)
        {
            if(__gcd(i, j) == 1)
            {
                nr++;
                //fout << i << "/" << j << endl;
            }
        }
    }
    fout << nr;
    return 0;
}