C++程序设计:1.12

#include<iostream>
using namespace std;
int main()
{
  // 声明变量
  double distance_in_miles = 24; // 距离(英里)
  double time_in_seconds = 6035; // 时间(秒)
  double distance_in_km; // 距离(千米)
  double time_in_hours; // 时间(小时)
  double speed_in_kmph; // 速度(千米/小时)

  // 计算距离和时间的转换
  distance_in_km = distance_in_miles * 1.6;
  time_in_hours = time_in_seconds / 3600;

  // 计算速度
  speed_in_kmph = distance_in_km / time_in_hours;

  // 输出结果
  cout << "The average speed of the runner is " << speed_in_kmph << " km/h." << endl;

  return 0;
}
全部评论

相关推荐

一表renzha:手写数字识别就是一个作业而已
点赞 评论 收藏
分享
身边有人上海、深圳&nbsp;6、7k&nbsp;都去了,真就带薪上班了。
小浪_coder:深圳除了一些计算机,UI设计,金融类等一些可以月薪过万的工作之外, 认识很多朋友做运营,营销,文员的工作, 月薪基本都在4-6K左右,还有大把人在干
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务