Advertisement
AndreyKlipikov

(Lehe) Prog 1.1

Dec 18th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include "iostream"
  2. #include "conio.h"
  3. #include "math.h"
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     double y = 0, n, l, r, x = 0;
  9.     cout << "Vvedite N:" << endl;
  10.     cin >> n;
  11.     cout << "Vvedite L:" << endl;
  12.     cin >> l;
  13.     cout << "Vvedite R:" << endl;
  14.     cin >> r;
  15.     cout << "| x\t| y\t|" << endl;
  16.     for(double i = l; i <= r; i += ((r-l)/n)) {
  17.         y = 1.7 * i * i * i - 6.3 * i + 2.7;
  18.         cout.precision(4);
  19.         cout << "| " << i << "\t| " << y << "\t|" << endl;
  20.         if (y > 0 && ((int)y % 2 == 0))
  21.             x++;
  22.     }
  23.     cout << "Kolichestvo neotricatelnih znacheniy funkcii, imeuschih chetnuu celuu chast: ";
  24.     cout << x;
  25.     _getch();
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement