Home > Back-end >  For the great god help, trapezoidal area
For the great god help, trapezoidal area

Time:10-08

Keyboard input trapezoid on the bottom of a, b, and the bottom high h, then based on the trapezoidal area area s formula, the final output as a result, requirement: output must have the text, the calculation results in two decimal places, tip: can be input in the shape of a trapezoid bottom a, first under the high end of b and h, and then based on the trapezoidal area area s formula, the final output, please fill in the blanks and complete the program, and analysis of the operation result,

# include & lt; Stdio. H> Int main () {

[1] a, b, h, s,//define variables

Printf (" please enter trapezoid on the bottom, the base and height. A, b, h \ n ");

The scanf ([2]);//keyboard input a, b, h

S=(a + b) * h/2;//calculating the area of the trapezoid

Printf (" trapezoid area s=% 2 f \ n ", [3]).//output calculation results

return 0; }

CodePudding user response:

Write their own, basic didn't do, also study goal programming,
If it is wrong, according to oneself idea also fill them up first
  • Related