TOPIC
Erro de 5% C++
irllambs asked 3 years ago
N consego achar a resposta errada no Udebug e esta dando erro de 5%
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d1,d2;
cin>>a>>b>>c;
d1=b-a;
d2=c-b;
if(a<b){
if(b>=c){
cout<<":("<<endl;
}
else if(b<c && abs(d1)>abs(d2)){
cout<<":("<<endl;
}
else if(b<c && abs(d1)<=abs(d2)){
cout<<":)"<<endl;
}
}
else if(a>b){
if(b<c){
cout<<":)"<<endl;
}
else if(b>c && abs(d2)<abs(d1)){
cout<<":)"<<endl;
}
else if(b>c && abs(d2)>=abs(d1)){
cout<<":("<<endl;
}
}
else{
if(b<c){
cout<<":)"<<endl;
}
else{
cout<<":("<<endl;
}
}
return 0;
}
This topic has not been answered yet. Be the first!