Header Ads

Header ADS

URI 1041 Coordinates of a Point Solution in C++

URI 1041 đŸ‘€ Coordinates of a Point  đŸ‘€Solution in C++

Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comments.




URI 1041 đŸ‘€ Coordinates of a Point  đŸ‘€Solution in C++

#include <bits/stdc++.h>
using namespace std;

int main(){

    double X,Y;
    cin>>X>>Y;

    if(X==0&&Y==0){
        cout<<"Origem"<<endl;
    }else if(X==0){
        cout<<"Eixo Y"<<endl;
    }else if(Y==0){
        cout<<"Eixo X"<<endl;
    }else if(X>0&&Y>0){
        cout<<"Q1"<<endl;
    }else if(X<0&&Y>0){
        cout<<"Q2"<<endl;
    }else if(X<0&&Y<0){
        cout<<"Q3"<<endl;
    }else if(X>0&&Y<0){
        cout<<"Q4"<<endl;
    }
    return 0;}

No comments

URI 1070 Six Odd Numbers Solution in C++

URI 1070 Six Odd Numbers Solution in C++ Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just fin...

Powered by Blogger.