Home > Back-end >  It's too difficult
It's too difficult

Time:10-13

#include
Int main ()
{
Double I;
Printf (" please enter the monthly profit \ n ");
If the scanf (" % ", & amp; I);
If (I>=0 & amp; & I<100000)
{
I=I * 0.1;
Printf (" % bonus should be lf \ n ", I);
}
Else if (I> 100000 & amp; & I
=200000){
I=100000 * 0.1 + (I - 100000) * 0.75;
Printf (" % bonus should be lf \ n ", I);
}
Else if (I> 200000 & amp; & I
=400000){
I=100000 * 0.1 + (I - 200000) * 0.5;
Printf (" % bonus should be lf \ n ", I);
}
Else if (I> 400000 & amp; & I
=600000){
I=100000 * 0.1 + (I - 400000) * 0.3;
Printf (" % bonus should be lf \ n ", I);
}
Else if (I> 600000 & amp; & I
=1000000){
I=100000 * 0.1 + (I - 600000) * 0.1;
Printf (" % bonus should be lf \ n ", I);
}
return 0;
}
Can't output

CodePudding user response:

The scanf (" % I f ", & amp; I); To the scanf (" % l f ", & amp; I);

CodePudding user response:

With a post code, a teacher?

Say oh aye LF % LF

CodePudding user response:

 # include & lt; stdio.h> 

Int main ()
{
Double I;
Printf (" please enter the monthly profit \ n ");
//the scanf (" % if ", & amp; I);
Lf the scanf (" % ", & amp; I);
If (I>=0 & amp; & I<100000)
{
I=I * 0.1;
Printf (" % bonus should be lf \ n ", I);
}
Else if (I> 100000 & amp; & I
=200000){
I=100000 * 0.1 + (I - 100000) * 0.75;
Printf (" % bonus should be lf \ n ", I);
}
Else if (I> 200000 & amp; & I
=400000){
I=100000 * 0.1 + (I - 200000) * 0.5;
Printf (" % bonus should be lf \ n ", I);
}
Else if (I> 400000 & amp; & I
=600000){
I=100000 * 0.1 + (I - 400000) * 0.3;
Printf (" % bonus should be lf \ n ", I);
}
Else if (I> 600000 & amp; & I
=1000000){
I=100000 * 0.1 + (I - 600000) * 0.1;
Printf (" % bonus should be lf \ n ", I);
}
return 0;
}

For your reference ~

In addition, it seems, are still lack of a else, really don't have any output for input is greater than the value of 1000000,
  • Related