#include<stdio.h>
#include<math.h>
#define PI 3.1416
main()
{
float u,alpha,g,height;
g=9.81;
printf("Enter the initial velocity and the angle (in degree):");
scanf("%f %f",&u,&alpha);
if(alpha<0 || alpha>180)
{
printf("Input angle should lie between 0 and 180.\n");
}
else
{
height=u*u*pow(sin(alpha*PI/180.0000),2)/2*g;
printf("The maximun height is %.4f m\n",&height);
}
}
我的这个是怎么回事呀
答案:1 悬赏:40 手机版
解决时间 2021-04-21 02:49
- 提问者网友:战皆罪
- 2021-04-20 05:11
最佳答案
- 五星知识达人网友:行路难
- 2021-04-20 06:45
帮你改过来了 错误的地方有注释
#include<stdio.h>
#include<math.h>
#define PI 3.1416
main()
{
float u,alpha,g,height;
g=9.81;
printf("Enter the initial velocity and the angle (in degree):");
scanf("%f %f",&u,&alpha);
if(alpha<0 || alpha>180)
{
printf("Input angle should lie between 0 and 180.\n");
}
else
{
height=u*u*pow(sin(alpha*PI/180.0000),2)/2*g;
printf("The maximun height is %.4f m\n",height); //这里怎么加了个取地址呢? 去掉就可以了
}
}
#include<stdio.h>
#include<math.h>
#define PI 3.1416
main()
{
float u,alpha,g,height;
g=9.81;
printf("Enter the initial velocity and the angle (in degree):");
scanf("%f %f",&u,&alpha);
if(alpha<0 || alpha>180)
{
printf("Input angle should lie between 0 and 180.\n");
}
else
{
height=u*u*pow(sin(alpha*PI/180.0000),2)/2*g;
printf("The maximun height is %.4f m\n",height); //这里怎么加了个取地址呢? 去掉就可以了
}
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯