#include<iostream>
using namespace std;
int main()
{
int nr1, nr2, cmmdc;
cout << "Primul numar:";
cin >> nr1;
cout << "Al doileanr: ";
cin >> nr2;
cmmdc = 1;
for (int i = 1; i <= nr1 && i <= nr2; i++)
{
if (nr1%i == 0 && nr2%i == 0)
cmmdc = i;
}
if (cmmdc==1)cout<<"pie";
else cout<<"nopie";
return 0;
}
Sper sa-ti fie de folos