x2311

Untitled

Jan 12th, 2022
847
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int nom(int x, int y) {
  6.     if (x > 0 && y > 0) {
  7.         return 1;
  8.     } else if (x < 0 && y > 0) {
  9.         return 2;
  10.     } else if (x < 0 && y < 0) {
  11.         return 3;
  12.     } else {
  13.         return 4;
  14.     }
  15. }
  16.  
  17.  
  18. int main() {
  19.  
  20.     int x, y;
  21.     cout << "(X): ";
  22.     cin >> x;
  23.     cout << "(Y): ";
  24.     cin >> y;
  25.  
  26.     cout << "rez: " << nom(x, y);
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment