Cod sursa(job #631886)

Utilizator SelonyEcho Slam Selony Data 9 noiembrie 2011 21:33:44
Problema Fractii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include<iostream>
#include<fstream>
using namespace std;

	ifstream f_one ( "fractii.in" );
	ofstream f_out ( "fractii.out" );

	int main(){
		int n,s=0;
		f_one >> n;

		for(int i = 1 ; i <= n ; i++)
			for(int j = 1 ; j <= n ; j++){
				if( i % j != 0 && j % i != 0)
					s++;
				if( i==1 || j==1)
					s++;
			}

		f_out<<s;
	};