Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int nr1, nr2, cmmdc;
  8. cout << "Primul numar:";
  9. cin >> nr1;
  10. cout << "Al doileanr: ";
  11. cin >> nr2;
  12.  
  13. cmmdc = 1;
  14. for (int i = 1; i <= nr1 && i <= nr2; i++)
  15. {
  16. if (nr1%i == 0 && nr2%i == 0)
  17. cmmdc = i;
  18. }
  19. if (cmmdc==1)cout<<"pie";
  20. else cout<<"nopie";
  21.  
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement