單項(xiàng)選擇題設(shè)銀行定期存款的年利率rate為2.25%,已知存款期為n年,存款本金為capital元,試編程計(jì)算并輸出n年后的本利之和deposit。 按要求在空白處填寫(xiě)適當(dāng)?shù)谋磉_(dá)式或語(yǔ)句,使程序完整并符合題目要求。#include <math.h> #include <stdio.h> int main() { int n; /* 存款期變量聲明 */ double rate; /* 存款年利率變量聲明 */ double capital; /* 存款本金變量聲明 */ double deposit; /* 本利之和變量聲明 */ printf("Please enter rate, year, capital:"); scanf("%lf,%d,%lf", &rate, &n, &capital); deposit = ________________; /* 計(jì)算存款利率之和 */ printf("deposit = %f/n", deposit); /* 打印存款利率之和 */ return 0; }
A、capital * pow(1+rate, n)
B、capital * pow(rate, n)
C、capital * pow(n, 1+rate)
D、capital * pow(n, rate)