#include <stdio.h>
#include <math.h>
int main() {
double P;
double B;
printf("\nPerpendicular:");
scanf("%lf", P);
printf("\n Base:");
scanf("%lf", B);
double H = sqrt(P * P + B * B);
printf("Hypoteneous:%lf", H);
return 0;
}
我正在尝试制作一个程序,允许用户通过输入用户的底边和垂直线来找到三角形的斜线,但是当我尝试运行该程序时,它只允许我输入底边和垂直线,而不是只是关闭而不显示低气压
您只需要确保传递了要读入的变量的引用:
printf("\nPerpendicular:");
scanf("%lf", &P);
printf("\n Base:");
scanf("%lf", &B);