Facebook
From Reliable Coyote, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 234
  1. #include <iostream>
  2. #include <cmath>
  3. int a,b;
  4. float x;
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     cout << "Podaj a" << endl;
  10.     cin >> a;
  11.     cout << "Podaj b" << endl;
  12.     cin >> b;
  13.     cout << "Funkcja y=" << a << "x+" << b << " jest ";
  14.     if(a<0)
  15.     {
  16.         cout << "malejaca" <<endl;
  17.     }
  18.     else {
  19.         if(a==0)
  20.         {
  21.         cout << " stala" <<endl;
  22.             if(b==0)
  23.             {
  24.                 cout << "Nieskonczenie wiele miejsc zerowych" << endl;
  25.             }
  26.             else
  27.             {
  28.                 cout <<"Brak miejsc zerowych" << endl;
  29.             }
  30.         }
  31.          else
  32.         {
  33.         cout << " rosnaca" <<endl;
  34.         }
  35.     }
  36.     x=(float)(-b)/(float)a;
  37.    cout << "Miejsce zerowe to: " <<x << endl;
  38.    //kat=a
  39.    cout << "Kat nachylenia to: " << (atan(a)*180)/M_PI;
  40.     return 0;
  41. }