G2A Many GEOs
SHARE
TWEET

Zadanie 6 Poprawione

Lukasz_Miskiewicz Mar 31st, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. float a,b;
  4.  
  5. float iloraz(float a, float b)
  6. {if(a>0 && b>0)
  7.     {return a/b;}
  8.        else
  9.         if (b==0)
  10.     {return -1;}
  11.     else
  12.     {return -2;};
  13. }
  14.  
  15. int main()
  16. {
  17.     cout<<"podaj liczby do podzielenia"<<endl;
  18.     cin>>a;
  19.     cin>>b;
  20.     if(iloraz(a,b)==-1)
  21.     {cout<<"nie dziel przez zero";}
  22.         else
  23.         if (iloraz(a,b)==-2)
  24.     {cout<<"nie dziel przez zero";}
  25.     else
  26.     {cout<<"iloraz wynosi "<<iloraz(a,b);}
  27.     return 0;
  28. }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top