Home > Back-end >  programming
programming

Time:10-31

Fuji apple in accordance with the standards of grade of colour and lustre is: (1) the shaded area is greater than or equal to 75%, is divided into special fruit; (2) the shaded area of less than 75%, greater than or equal to 50%, is divided into a first-class fruit; (3) the shaded area is less than 50%, greater than or equal to 25%, divided into second-class fruit; (4) the shaded area is less than 25%, the fruit is classified into thereof, please write the code, using the input function input area (percentage is converted to a decimal), Fuji shaded branch structure implementation USES judgment level of apple's color and output eventually determine the results, such as: input is 0.4, the output for apple chroma 40% judged to be second-class fruit,

CodePudding user response:

 
#include

using namespace std;

Int main ()
{
Double a;
Cin & gt;> a;
If (a & gt; {
=0.75)cout <"Special fruit";
}
Else if (a & gt; {
=0.5)cout <"First fruit";
}
Else if (a & gt; {
=0.25)cout <"Second-class fruit";
}
The else {
cout <"Substandard fruit";
}
return 0;
}