Pagini recente » Cod sursa (job #1741804) | Cod sursa (job #1585292) | Cod sursa (job #2322515) | Cod sursa (job #857362) | Cod sursa (job #1125822)
#include <fstream>
using namespace std;
ifstream in("fractii.in");
ofstream out("fractii.out");
bool ireductibila(int i,int j);
int main()
{
int N,nr=0;
in>>N;
for(int i=1;i<=N;++i)
{
for(int j=1;j<=N;++j)
{
if(ireductibila(i,j))
++nr;
}
}
out<<nr;
in.close();
out.close();
return 0;
}
bool ireductibila(int i,int j)
{
if(i!=1 && j!=1 && (i%j==0 || j%i==0))
return 0;
}