-->
当前位置:首页 > 题库

PROGRAMMING:Program error correction: find the length of the third side

Luz5年前 (2021-05-10)题库429
The function of the following program is: given the length of the two sides of the triangle and the size of the angle (in degrees), find out the length of the third side. If necessary, the approximate value of PI is 3.141592653589793.
`#`include
int main(void);
{int a,b,c,t; // a. B and C are side length, t is included angle
scanf("%d%d%d",a,b,t);
c=sqrt(a^2+b^2-2a*b*cost);
printf("length=%d\n",c)
return 0;
}
Debug and run the program to correct all syntax and logic errors in the program.
###Input format:
Enter three numbers representing the length and angle of the two sides in a row, separated by spaces.
###Output format:
Output the value of the length of the third edge, retain two decimal places, and finally wrap.
###Input example:
```in
1 2 60
```
###Output example:
```out
length=1.73
```







answer:If there is no answer, please comment