编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习3

#include <iostream>
using namespace std;
int main()
{
 double count=0;
 long double cleo=100;
 long double dap=100;
 do
 {
  cleo+=cleo*0.05;
  dap+=10;
  count++;
 }while(cleo<dap);
 cout<<"经过"<<count<<"年,cleo的财富 "<<cleo<<" 超过了"<<"dap的财富 "<<dap<<endl;
 system("pause");
 return 0;
}

原文地址:https://www.cnblogs.com/lynnycy/p/3443283.html