Cod sursa(job #964960)
Utilizator | Data | 22 iunie 2013 20:17:38 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <iostream>
#include<fstream>
using namespace std;
int n,p,k,aux;
float i,j,v[10000];
int main()
{
ifstream f("fractii.in");
ofstream g("fractii.out");
f>>n;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
aux=1;
for(k=0;k<=p;k++)
if(i/j==v[k])
aux=0;
if(aux==1)
{
p++;
v[p]=i/j;
}
}
g<<p;
return 0;
}