Cod sursa(job #1753006)

Utilizator epermesterNagy Edward epermester Data 5 septembrie 2016 17:54:10
Problema Fractii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include <iostream>
#include <fstream>

using namespace std;

int main() {
	int N;
	ifstream in("fractii.in");
	in >> N;
	int k = 0;
	for (int sz = 1;sz <= N;sz++) {
		for (int n = 1;n <= N;n++) {
			if (sz == 1 || n == 1 || (sz%n && n%sz)) k++;
		}
	}
	ofstream out("fractii.out");
	out << k;
}