Cod sursa(job #1190247)
Utilizator | Data | 24 mai 2014 20:11:07 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
using namespace std;
void Citire (long int &N)
{
ifstream fin ("fractii.in");
ofstream fout("fractii.out");
fin>>N;
fin.close ();
int c=0;
for (int i=1;i<=N;i++)
for (int j=1;j<=N;j++)
if (i%j!=0 || (j==1 && i!=1))
c++;
fout<<c;
fout.close ();
}
int main ()
{
long int N;
Citire(N);
return 0;
}