MarcinKrol

Zad15

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