标签: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