1 条题解
-
0
C :
#include<stdio.h> #define CURRENT 100 main() { int year; double growRate; double output; scanf("%lf",&growRate); output = CURRENT; for(year = 0;output < 2*CURRENT;year++) { output = output * (1+growRate); } printf("%d",year); return 0; }C++ :
#include<stdio.h> #define CURRENT 100 main() { int year; double growRate; double output; scanf("%lf",&growRate); output = CURRENT; for(year = 0;output < 2*CURRENT;year++) { output = output * (1+growRate); } printf("%d",year); return 0; }
- 1
信息
- ID
- 1973
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者