My code is a question, I'm learning to program and using the codcad site, the question is in the image. When I send my code, it only has 60 points of 100. I would like to know what I am doing wrong.
Follow the image.
Edit: I tried to solve the question using only what I learned on the site, more advanced things still do not know very well, so I may have gone through a more complicated logic.
Questionobs:Thequestionisrelatedtoalistofexercisesaboutif.Carnival(OBI2012,Phase2,Level1)
CarnivalisaholidaynormallycelebratedinFebruary;inmany Braziliancities,themainattractionistheparadesofschoolsof samba.Thevariousassociationsgotothesoundoftheirsambas-tangosand arejudgedbytheleagueofsambaschoolstodeterminethechampion ofCarnival.
Eachassociationisevaluatedinseveralaspects;ineachcase,each schoolreceivesfivegradesvaryingfrom5.0to10.0.Thefinalgradeof schoolinagivenitemisthesumofthethreecentralnotesreceived bytheschool,excludingthehighestandlowestofthefivegrades.
Astherearemanysambaschoolsandmanyquests,thepresident askedyoutowriteaprogramthat,giventhe
Input The input contains a single line, containing five Ni numbers (1≤ i ≤5), all with one decimal place, indicating the notes received by the association in one of the requirements.
Output Your program should print a single line, containing a single number with exactly one decimal place, the final grade of the school of samba in the considered subject.
Restrictions
5.0 ≤Ni ≤10.0**Exemplos de Entrada** ...... *Exemplos de Saída* **6.4 8.2 8.2 7.4 9.1** ...... *23.8* **10.0 10.0 5.0 5.0 10.0** ...... *25.0*
Code
#include <iostream>
using namespace std;
int main(){
double a, b, c, d, e;
cin>>a>>b>>c>>d>>e;
if (a>=b and a>=c and a>=d and a>=e){
if(b<a and b<=c and b<=d and b<=e){
cout<<c+d+e;
}
if(c<b and c<=d and c<=e) {
cout<<b+d+e;
}
if(d<=b and d<c and d<=e){
cout<<b+c+e;
}
if(e<a and e<b and e<c and e<d){
cout<<b+c+d;
}
}
if (b>a and b>=c and b>=d and b>=e){
if(a<b and a<=c and a<=d and a<=e){
cout<<c+d+e;
}
if(c<a and c<=d and c<=e){
cout<<a+d+e;
}
if (d<a and d<c and d<=e){
cout<<a+c+e;
}
if(e<a and e<b and e<c and e<d){
cout<<a+c+d;
}
}
if (c>a and c>b and c>=d and c>=e){
if(a<=b and a<=d and a<=e){
cout<<b+d+e;
}
if(b<a and b<=d and b<=e){
cout<<a+d+e;
}
if(d<a and d<b and d<=e){
cout<<a+b+e;
}
if(e<a and e<b and e<c and e<d){
cout<<a+b+d;
}
}
if(d>a and d>b and d>c and d>=e){
if(a<=b and a<=c and a<=e){
cout<<b+c+e;
}
if(b<a and b<=c and b<=e){
cout<<a+c+e;
}
if(c<a and c<b and c<=e){
cout<<a+b+e;
}
if(e<a and e<b and e<c and e<d){
cout<<a+b+c;
}
}
if(e>a and e>b and e>c and e>d){
if(a<=b and a<=c and a<=d){
cout<<b+c+d;
}
if(b<a and b<=c and b<=d){
cout<<a+c+d;
}
if(c<a and c<b and c<=d){
cout<<b+a+d;
}
if(e<a and e<b and e<c and e<d){
cout<<a+b+c;
}
}
}
obs: I'm sorry for anything I've done wrong I'm new to the site and if I'm done wrong I'll accept suggestions and tips. obs2: I accept tips and suggestions as well for programming. Thank you for your attention.