pascal:
var
s,v,p:real;
month:integer;
begin
month:=0;
readln(s,v,p);
while (v<s) do
v:=v+(v/100*p);
month:=month + 1;
end;
writeln(month);
end.
c++:
#include <iostream>
using namespace std;
int calcMonth(int s,double v, int p)
{
int month = 0;
while(v<s)
v+=v/100*p;
month++;
}
return month;
int main()
int S,V,P;
cin>>S>>V>>P;
cout<<calcMonth(S,V,P);
return 0;
pascal:
var
s,v,p:real;
month:integer;
begin
month:=0;
readln(s,v,p);
while (v<s) do
begin
v:=v+(v/100*p);
month:=month + 1;
end;
writeln(month);
end.
c++:
#include <iostream>
using namespace std;
int calcMonth(int s,double v, int p)
{
int month = 0;
while(v<s)
{
v+=v/100*p;
month++;
}
return month;
}
int main()
{
int S,V,P;
cin>>S>>V>>P;
cout<<calcMonth(S,V,P);
return 0;
}