Skip to content

Instantly share code, notes, and snippets.

@PedroRacchetti
Created April 14, 2020 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PedroRacchetti/a7aacaef64aec8b1b177cf6c6eb61aac to your computer and use it in GitHub Desktop.
Save PedroRacchetti/a7aacaef64aec8b1b177cf6c6eb61aac to your computer and use it in GitHub Desktop.
#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