Cod sursa(job #2489584)

Utilizator Stefan15stefan Stefan15 Data 9 noiembrie 2019 01:52:00
Problema Fractii Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <iostream>
#include <fstream>

using namespace std;

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

int main()
{
	int n;
	int count = 0;
	f >> n;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			if (i != j) {
				if (i > 1)
				{
					if (j % i != 0)
					{
						count++;
						cout << i << " / " << j << endl;
					}
				}
				else
				{
					count++;
					cout << i << " / " << j << endl;
				}
			}
		}
	}
	g << count;
	return 0;
}