谁会求三角形面积呀(C语言)

Write a C program using MPI to calculate the area of a ***. The process with the rank: 0 sends two floating point numbers for the base and height to all other processes. Each of these processes calculate the area of the *** and display.

area = b * h/2

The following is just a sample dialog. Your program must work for any floating point number.

Enter two floating point numbers for the base and the height of a ***.

10 12

Height = 12.00, base = 10.00

The area of the *** is: 60.00

Height = 12.00, base = 10.00

The area of the *** is: 60.00

Height = 12.00, base = 10.00

The area of the *** is: 60.00

Height = 12.00, base = 10.00

The area of the *** is: 60.00

#笔试题目##C/C++#
全部评论
高精度乘法,小数点位置注意一下。
点赞 回复 分享
发布于 2019-11-21 11:13

相关推荐

评论
1
收藏
分享
牛客网
牛客企业服务