Advertisement
elektryk798

Untitled

Mar 7th, 2016
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     double wsp[2]= {1,-4},dokladnosc=0.01,lewy,prawy,w_l=0,w_p=0;
  9.     cin >>lewy>>prawy;
  10.     for(int i=1; i>=0; i--)
  11.     {
  12.         w_l+=wsp[i]*pow(lewy,abs(i-1));
  13.         w_p+=wsp[i]*pow(prawy,abs(i-1));
  14.     }
  15.     cout <<w_l<<"\n\n"<<w_p<<endl;
  16.     //while()
  17.     if (w_l>0&&w_p>0 || w_l<0&&w_p<0)
  18.         cout <<"nie ma miejsc zerowych w zakresie"<<endl;
  19.     else
  20.         cout <<"sa miejsca zerowe w zakresie"<<endl;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement