Cod sursa(job #1168892)
Utilizator | Data | 9 aprilie 2014 20:52:30 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
using namespace std;
int main()
{int n;
float q,i,j;
ifstream f("fractii.in");
ofstream g("fractii.out");
f>>n;
float v[1000];
int l,p,aux,k;
i=0;
p=0;
while(i<n)
{i++;
j=0;
while(j<n)
{j++;
q=i/j;
v[p]=q;
p++;
}
}
l=0;
aux=p;
while(l<p)
{l++;
k=l;
while(k<=p)
{k++;
if(v[k]==v[l])
aux--;
}
}
g<<aux;
return 0;
}