#include<stdio.h>
#include<math.h>
int main()
{
int n;
double b,h;
scanf("%lf",&b);
scanf("%d",&n);
h=b*pow(1+0.0225,n);
printf("%.6lf",h);
return 0;
}
贴一下原题看一下?目前代码看着没什么问题
我查了一下,原题目是先输入年份后输入本金的,确认一下你接受的输入和原题目对应
有帮助望采纳~
比如尝试改为
#include <stdio.h>
#include <math.h>
int main()
{
int n;
double b, h;
scanf("%d%lf", &n, &b);
h = b * pow(1 + 0.0225, n);
printf("%.6lf", h);
return 0;
}