投资收益——while

#include<bits/stdc++.h>//fixed<<setprecision(2)
using namespace std;//for(int i=1;i<=a;i++)
int main()
{
    
    
	float r,m,y,a,b,c=0;
	cin>>r>>m>>y;
	a=1+r/100.0;
	b=m;
	while(b<=y)
	{
    
    
		b*=a;
		c++;
	}
	cout<<c;
    return 0;
}

猜你喜欢

转载自blog.csdn.net/m0_52628784/article/details/110312771