c++

wch123 发表于 1年前 · 关联问题 计算翻一番的年份

include

include <math.h>

using namespace std;

int main() {

double a =0; cin>> a; double x=1; int year=0; while(x<2){ x=x*(1+a); year++;} cout<<year; }