Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. //29 pusl. 3 uzd.
  2. #include <iomanip>
  3. #include <iostream>
  4. #include <cmath>
  5. using namespace std;
  6. int main()
  7. {
  8.     int x, x1, x2, y1, y2;
  9.  
  10.     cout << "Intervalo pradzia: "; cin >> x1;
  11.     cout << "Intervalo pabaiga: "; cin >> x2;
  12.  
  13.     x=x1;
  14.  
  15.     for (x; x <= x2; x++) {
  16.         y1 = x * 2 + 2;
  17.         y2 = x * 3 + 1;
  18.         cout << setw(4) << fixed << x << setw(4) << fixed << y1 << setw(4) << fixed << y2 << "       "; if (y1==y2) cout << "Susikerta\n"; else cout << "***\n";
  19.     };
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement