This repository was archived by the owner on May 18, 2024. It is now read-only.
forked from its-anaehm/CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPuntoCuadrante.cpp
More file actions
53 lines (49 loc) · 1.41 KB
/
PuntoCuadrante.cpp
File metadata and controls
53 lines (49 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
@author its_anaehm
@date 07-2020
@version 0.1
*/
/*
Algoritmo en C++ que tome como entrada un punto a que pertenece a los números reales y despliega en pantalla a qué cuadrante pertenece el punto (1,2,3,4) o si está ubicado sobre algún eje coordenado (x,y) o si ese punto es el origen(origen).
*/
#include<iostream>
using namespace std;
int main(){
float x=0, y=0;
cin>>x;
cin>>y;
if(x>0 && y>0){
cout<<"1"<<endl;
}else{
if(x<0 && y>0){
cout<<"2"<<endl;
}else{
if(x<0 && y<0){
cout<<"3"<<endl;
}else{
if(x>0 && y<0){
cout<<"4"<<endl;
}else{
if(x>0 && y==0){
cout<<"X"<<endl;
}else{
if(x<0 && y==0){
cout<<"-X"<<endl;
}else{
if(x==0 && y<0){
cout<<"-Y"<<endl;
}else{
if(x==0 && y>0){
cout<<"X"<<endl;
}else{
cout<<"Origen"<<endl;
}
}
}
}
}
}
}
}
return 0;
}