c语言编程题 整存整取,C语言拓展训练编程题.doc
时间: 2023-10-03 14:07:02 浏览: 132
很抱歉,我无法打开你提供的文件。但是,我可以给你提供一个整存整取的C语言编程示例:
```c
#include <stdio.h>
int main() {
float principal, rate, time, interest;
printf("Enter principal amount: ");
scanf("%f", &principal);
printf("Enter interest rate: ");
scanf("%f", &rate);
printf("Enter time (in years): ");
scanf("%f", &time);
interest = (principal * rate * time) / 100;
printf("Interest amount: %.2f\n", interest);
printf("Total amount: %.2f\n", principal + interest);
return 0;
}
```
这个程序要求用户输入本金、利率和时间,然后计算出利息和总额。你可以根据需要进行修改和调整。
阅读全文