这个程序哪里错了,已知三角形三边求三个角program mainimplicit none real :: a, b, c real :: x, y, z write(*,*) "please input a, b, c:" read(*,*) a, b, c x=acos((c**c+b**b-a**a)/2*b*c) y=acos((c**c+a**a-b**b)/2*a*c)
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/20 13:25:28
这个程序哪里错了,已知三角形三边求三个角program mainimplicit none real :: a, b, c real :: x, y, z write(*,*) "please input a, b, c:" read(*,*) a, b, c x=acos((c**c+b**b-a**a)/2*b*c) y=acos((c**c+a**a-b**b)/2*a*c)
这个程序哪里错了,已知三角形三边求三个角
program main
implicit none
real :: a, b, c
real :: x, y, z
write(*,*) "please input a, b, c:"
read(*,*) a, b, c
x=acos((c**c+b**b-a**a)/2*b*c)
y=acos((c**c+a**a-b**b)/2*a*c)
z=acos((a**a+b**b-c**c)/2*b*a)
write(*,*) x, y, z
call sleep(2)
stop
end
这个程序哪里错了,已知三角形三边求三个角program mainimplicit none real :: a, b, c real :: x, y, z write(*,*) "please input a, b, c:" read(*,*) a, b, c x=acos((c**c+b**b-a**a)/2*b*c) y=acos((c**c+a**a-b**b)/2*a*c)
中间3句应修改为:
x=acos((c*c+b*b-a*a)/(2*b*c))
y=acos((c*c+a*a-b*b)/(2*a*c))
z=acos((a*a+b*b-c*c)/(2*b*a))