> 其他 >
输入一个直角三角形的两个直角边的边长,求斜边的长度并输出
在C语言条件下.
人气:144 ℃ 时间:2020-05-17 13:33:47
解答
#include "stdio.h"
#include "math.h"
void main(){
int a,b;
float c;
printf("输入直角边长度:");
scanf("%d,%d",&a,&b);
c=(float)sqrt(a*a+b*b);
printf("斜边长度为%5.3f",c);
}
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版