Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1.  
  2. #include<iostream>
  3. #include<clocale>
  4. #include<cstddef>
  5. using namespace std;
  6.  
  7. int main(){
  8. setlocale(LC_ALL,"rus");
  9. int x,y;
  10.  
  11. cout<< "Введите X: ";//Просим ввести x.
  12. cin>>x;
  13.  
  14. cout<<"Введите Y: ";//Просим ввести y.
  15. cin>>y;
  16.  
  17. int i; //Переменная, номер квадранта.(наш ответ).}
  18.  
  19. if (x > 0) {
  20. if (y > 0) {
  21. i = 1;
  22. } else {
  23. i = 4;
  24. }
  25. } else {
  26. if (y > 0) {
  27. i = 2;
  28. } else {
  29. i = 3;
  30. }
  31. }
  32.  
  33. return i;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement