【问题描述】输入直角三角形的两个直角边的边长,计算斜边的长度,输出结果保留2位小数。若a、b代表直角边,c代表斜边,则斜边的计算公式如下
float a ,b,c;
c = sqrt(aa+bb);
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
int a,b;
scanf("%d %d",&a,&b);
printf("%.2lf",sqrt(a*a+b*b));
return 0;
}
#include <stdio.h>
#include <math.h>
int main()
{
double a,b,c;
scanf("%lf %lf",&a,&b);
c = sqrt(a*a+b*b);
printf("%.2lf",c);
return 0;
}
请采纳,我需要积分,下载东西 c = sqrt (a^2+b^2);