码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 1038[Biker's Trip Odometer]简单计算

时间:2017-02-18 22:53:15      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:main   include   http   print   int   题目   思想   计算   problem   

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1038

题目大意:给轮子直径,转数,时间。要求输出走过的距离和时速(mile为单位)

关键思想:纯算

代码如下:

#include <iostream>
using namespace std;
#define pi 3.1415927

int main(){
	double d,r,t,l;
	int cnt=1;
	while(cin>>d>>r>>t&&r){
		l=d*pi;//inch
		printf("Trip #%d: %.2f %.2f\n",cnt++,l*r/12/5280,l*3600*r/12/5280/t);
	}
	return 0;
} 

  

HDU 1038[Biker's Trip Odometer]简单计算

标签:main   include   http   print   int   题目   思想   计算   problem   

原文地址:http://www.cnblogs.com/G-M-WuJieMatrix/p/6414277.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!