Norbysweg

f73

Sep 29th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void beolv(int &n)
  6. {
  7. cin>>n;
  8. }
  9. void kiir(int n)
  10. {
  11. cout<<n;
  12. }
  13. bool rel(int a,int b)
  14. {
  15. int i=2;
  16. bool f=1;
  17. if (a<b)
  18. {
  19. a=a+b;
  20. b=a-b;
  21. a=a-b;
  22. }
  23. while(i<=a/2)
  24. {
  25. if (a%i==0 && b%i==0)
  26. return 0;
  27. i++;
  28. }
  29. return 1;
  30. }
  31. int main()
  32. {
  33. int a,b;
  34. beolv(a);
  35. beolv(b);
  36. if (rel(a,b)==0)
  37. cout<<"nem";
  38. else
  39. cout<<"igen";
  40. return 0;
  41. }
  42.  
Add Comment
Please, Sign In to add comment