Advertisement
WiktorJagielski

Zad 15

Mar 30th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5. int LICZBYPITAGOREJSKIE(int a, int b, int c)
  6. {
  7. if(a*a+b*b==c*c)
  8. {
  9. return 1;
  10. }
  11. else {
  12. return 0;
  13. }
  14. }
  15. int main()
  16. {
  17. int a;
  18. int b;
  19. int c;
  20. cout << "Pierwsza liczba calkowita: ";
  21. cin >>a;
  22. cout << "Pierwsza liczba calkowita: ";
  23. cin >>b;
  24. cout << "Pierwsza liczba calkowita: ";
  25. cin >>c;
  26. if (LICZBYPITAGOREJSKIE(a,b,c)==1)
  27. {
  28. cout << "Podane liczby sa liczbami pitagorejskimi";
  29. }
  30. else
  31. {
  32. cout << "Podane liczby nie sa liczbami pitagorejskimi";
  33. }
  34.  
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement