Created
April 14, 2020 18:45
-
-
Save PedroRacchetti/a7aacaef64aec8b1b177cf6c6eb61aac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> //biblioteca utilizada | |
#include <cmath> //biblioteca utilizada | |
using namespace std; | |
int main() | |
{ | |
int R1, X1, Y1, R2, X2, Y2; //declaração das variáveis que compõem | |
float XY; //declaração da variável utilizada na lógica | |
while(cin >> R1 >> X1 >> Y1 >> R2 >> X2 >> Y2) //loop para ler todas as variáveis de entrada | |
{ | |
XY = sqrt(((X2 - X1) * (X2 - X1)) + ((Y2 - Y1) * (Y2 - Y1))); //cálculo 1 | |
if(XY<=(R1-R2)) //condição cálculo 2 | |
{ | |
cout << "RICO" << endl; //consequência | |
} | |
else //condição do cáculo 2 negada | |
{ | |
cout << "MORTO" << endl; //consequência | |
} | |
} | |
return 0; //zera a programação | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment