Cod sursa(job #2130433)
| Utilizator | Data | 13 februarie 2018 18:07:39 | |
|---|---|---|---|
| Problema | Fractii | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fractii.in");
ofstream fout("fractii.out");
long counter;
float stiva[100001];
void nuContine(float x)
{
bool contine = true;
for(int i = 1; i <= counter && contine ; i++)
if(x == stiva[i])
contine = false;
if(contine)
stiva[++counter] = x;
}
int main()
{
long n;
fin >> n;
for(int i = 1; i<= n; i++)
for(int j = 1; j <= n; j++)
nuContine(float(i)/float(j));
fout << counter;
}
