Cod sursa(job #314725)
Utilizator | Data | 12 mai 2009 18:33:18 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
fstream f("fractii.in",ios::in);
fstream g("fractii.out",ios::out);
int i,j,n,x=0;
f>>n;
for (i=2;i<=n;i++)
for (j=1;j<=n;j++)
{
if (i%j && j%i || j==1)
{
x++;
}
}
g<<x+n;
f.close(); g.close();
return 0;
}