zoj1813
2015-07-25 20:57
253 查看
简单题
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int num = 0;
while(1)
{
num ++;
double diameter,time,revolutions,a,b;
cin >> diameter >> revolutions >> time;
if(revolutions == 0)
break;
a = revolutions * 3.1415927 * diameter/(12*5280);
b = a*3600/time;
cout << setiosflags(ios::fixed);
cout << "Trip #" << num << ": " << setprecision(2) << a << ' ' <<setprecision(2) << b << endl;
}
return 0;
}
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int num = 0;
while(1)
{
num ++;
double diameter,time,revolutions,a,b;
cin >> diameter >> revolutions >> time;
if(revolutions == 0)
break;
a = revolutions * 3.1415927 * diameter/(12*5280);
b = a*3600/time;
cout << setiosflags(ios::fixed);
cout << "Trip #" << num << ": " << setprecision(2) << a << ' ' <<setprecision(2) << b << endl;
}
return 0;
}