Advertisement
MichalWalczak

Zad 15

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