Cod sursa(job #1050976)
Utilizator | Data | 9 decembrie 2013 15:41:29 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<fstream>
using namespace std;
ifstream f("fractii.in");
ofstream g("fractii.out");
int n,s,x,y;
float i,j;
int main()
{f>>n;
s=0;
for(i=1;i<=n;i++)
{for(j=1;j<=n;j++)
{x=i;
y=j;
if(j==1||i/j!=int(i/j))
{s++;
if(j/i==int(j/i)&&i!=1&&j!=1||y%x==0)
s--;}
}
}
g<<s;
}