1. 编写一个程序,计算一个喷气式战斗机从航空母舰上的弹射器出发后的加速度,其中,已知飞机的起飞速度和弹射器对飞机从停止到起飞的加速的距离。这里假定飞机做匀速运动。还需要计算的是战斗机加速到起飞速度的时间(t)。程序中提示用户时,要注意指明每次输入的单位。其中一次输入278km/h的起飞速度和94m的距离。
相关公式(v是速度,a是加速度,t是时间,s是距离):
v=at
s=1/2at*t
帮忙编一道c语言程序题
答案:4 悬赏:10
解决时间 2021-04-27 23:48
- 提问者网友:不懂我就别说我变
- 2021-04-27 06:32
最佳答案
- 二级知识专家网友:冷眼_看世界
- 2021-04-27 08:04
#include <stdio.h>
#include <math.h>
int main()
{
double a = 0.0; // 加速度
double t = 0.0; // 加速时间
double v0 = 0.0, s = 94.0, v = 278.0; // 初速度,加速距离,起飞速度
printf("输入起飞速度(km/h)、弹射距离(m),如输入278km/h,94m:\n");
scanf("%lfkm/h,%lfm", &v, &s);
v = v / 3.6; // 转换成m/s
a = pow(v, 2)/(2*s); // 计算加速度
t = sqrt(2*s/a); // 计算加速时间
printf("加速度a=%.3lf,加速时间t=%.3lf", a, t);
return 0;
}
#include <math.h>
int main()
{
double a = 0.0; // 加速度
double t = 0.0; // 加速时间
double v0 = 0.0, s = 94.0, v = 278.0; // 初速度,加速距离,起飞速度
printf("输入起飞速度(km/h)、弹射距离(m),如输入278km/h,94m:\n");
scanf("%lfkm/h,%lfm", &v, &s);
v = v / 3.6; // 转换成m/s
a = pow(v, 2)/(2*s); // 计算加速度
t = sqrt(2*s/a); // 计算加速时间
printf("加速度a=%.3lf,加速时间t=%.3lf", a, t);
return 0;
}
全部回答
- 1楼网友:ー何必说爱
- 2021-04-27 09:30
#include<stdio.h>
void main()
{
printf("请输入战斗机起飞速度(km/h)和加速的距离(m): ");
float vt, s;
scanf( "%f%f",&vt,&s );
float t=2*s/(vt*1000/3600);
float a=(vt*1000/3600)/t;
printf("起飞过程中的加速度和起飞所用时间:%f %f\n", a,t);
}
- 2楼网友:眠于流年
- 2021-04-27 09:07
t=2s/v;
a=v*v/(2s)
include<stdio.h>
void mian()
{
double a,s,v,t;
printf("Please input start speed v=:");
scanf("%d",&v);
printf("Please input distance s=:");
scanf("%d",&s);
t=2*s/v;
a=v*v/(2*s);
printf("The used time is t=:%d",&t);
printf("The accelerated speed is a=:%d",&a);
}
- 3楼网友:茫然不知崩溃
- 2021-04-27 08:40
#include "stdio.h"
static int count=0;
void fun(int n){
if(n==0)
count++;
else{
fun(n-1);
if(n>=2)
fun(n-2);
}
}
int main()
{
int n;
scanf("%d", &n);
fun(n);
printf("%d", count);
return 0;
}
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯