#include
#include
#include
using namespace std;
int main(int argc, char argv[])
{
ifstream cin("F:\\test.txt");
int w, d;
int count = 1;
double year;
unsigned long result;
while (cin >> w >> d)
{
if (w == 0 && d == 0)
break;
year = log(810.0 / d*w) * 5730 / log(2);
cout << "Sample #" << count << endl;
if (year < 10000)
{
result = ((unsigned long)((year + 50) / 100)) * 100;
}
else
{
result = ((unsigned long)((year + 500) / 1000)) * 1000;
}
cout << "The approximate age is " << result << " years." << endl;
cout << endl;
count++;
}
return 0;
}
06-05