Cod sursa(job #1087427)

Utilizator SCBbestofSocaciu-Cumpanasu Bogdan SCBbestof Data 19 ianuarie 2014 13:41:41
Problema Fractii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <iostream>
#include <bitset>
#include <fstream>

using namespace std;

ifstream f("fractii.in");
ofstream g("fractii.out");

int main()
{
    long N;
    f>>N;
    long total = 0;
    long M= N/2;
    ++M;
    for(int i = 1; i <= M; ++i)
    {
        for(int j = 2; j<= N ; ++j)
        {
            if(i%j != 0)
            {
                ++total;
            }
        }
    }
    total*=2;
    ++total;
    g<<total;
    return 0;
}