Pagini recente » Diferente pentru adobe-code-pandas/clasament/runda-1 intre reviziile 3 si 8 | Atasamentele paginii Iopds | Cod sursa (job #1575030) | Rating jingoiu george (geoegroeg) | Cod sursa (job #1342729)
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("fractii.in");
ofstream out("fractii.out");
int cmmdc(int a,int b)
{int r;
while(b)
{r=a%b;
a=b;
b=r;}
return a;
}
int main()
{
int n,i,j,k=0;
in>>n;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++) if(cmmdc(i,j)==1) k++;
out<<k;
return 0;
}