
C语言问题《C Primer Plus》第四章编程练习(第六版)
1个回答
展开全部
这是《C Primer Plus》第四章编程练习(第六版)4.8.5的练习题:
参考代码如下:
#include <stdio.h>
int main(void){
float downloadSpeed,fileSize;
printf("Please input your download speed(Mb/s):");
scanf("%f",&downloadSpeed);
printf("Please input you file size(Mb):");
scanf("%f",&fileSize);
printf("At %.2f megabits per second, a file of %.2f megabytes\n",downloadSpeed,fileSize);
printf("download in %.2f seconds.\n",fileSize*8/downloadSpeed);
}
执行结果如下:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询