Cod sursa(job #1275083)

Utilizator hackerul555Tapucovidiu hackerul555 Data 24 noiembrie 2014 19:06:45
Problema Fractii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include <fstream>
using namespace std;
ifstream f("fractii.in");
ofstream g("fractii.out");
long long n,x,y,nr;
int main()
{
    f>>n;
    nr=n;
    for(x=2; x<=n; x++)
    {
        for(y=1; y<=n; y++)
        {
            if(y!=1) {if(x%y!=0 and y%x!=0) nr++;}
                else nr++;

        }
    }
    g<<nr;
    g.close();
    return 0;
}