Cod sursa(job #1295647)

Utilizator tudor199G Tudor tudor199 Data 19 decembrie 2014 22:11:11
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    int a=1,b,n=0,m;
    fstream f("fractii.in",ios::in);
    fstream g("fractii.out",ios::out);
    f>>b;
    while(b>0)
    {
        while(a<b)
        {
            m=b%a;
            if((m!=0)||(a==1)||(b==1)) n=n+1;
            a++;
        }
        b--;
        a=1;
    }
    n=n*2+1;
    g<<n;
    f.close();
    g.close();
    return 0;
}