谁会求三角形面积呀 求指教~
Write a C program using MPI to calculate the area of a triangle. 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 triangle 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 triangle.
10 12
Height = 12.00, base = 10.00
The area of the triangle is: 60.00
Height = 12.00, base = 10.00
The area of the triangle is: 60.00
Height = 12.00, base = 10.00
The area of the triangle is: 60.00
Height = 12.00, base = 10.00
The area of the triangle is: 60.00
Write a C program using MPI to calculate the area of a triangle. 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 triangle 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 triangle.
10 12
Height = 12.00, base = 10.00
The area of the triangle is: 60.00
Height = 12.00, base = 10.00
The area of the triangle is: 60.00
Height = 12.00, base = 10.00
The area of the triangle is: 60.00
Height = 12.00, base = 10.00
The area of the triangle is: 60.00
全部评论
相关推荐
点赞 评论 收藏
分享
2025-12-31 14:19
门头沟学院 产品经理
哈利波特不吃辣椒:因为实习你记住不是正职,本来就是双方可以随时毁约的,所以实习记住别投入过多感情,份内事情做好就行,开了就开了怕什么,不是转正的实习都无所谓 点赞 评论 收藏
分享
格力公司福利 331人发布
查看12道真题和解析