Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. // Čia čj su cin >> reikėtų, tai jei ką atkomentuok;
  9.  
  10. /*
  11. int x1;
  12. int x2;
  13.  
  14. cout << "Iveskite x1: "; cin >> x1;
  15. cout << "Iveskite x2: "; cin >> x2;
  16.  
  17. */
  18. int x1 = -5;
  19. int x2 = 5;
  20.  
  21. // y = (x + 9) / x^3 - 8
  22.  
  23. for(int i = x1; i <= x2; i++) {
  24. double y = (double)(i + 9) / ( (i * i * i) - 8);
  25.  
  26. if(isinf(y))
  27. cout << i << "\t\t" << "neapibrezta" << endl;
  28. else
  29. cout << i << "\t\t" << fixed << setprecision(2) << y << endl;
  30. }
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement