1031: 習題3-2 計算存款利息(1)

#include<stdio.h> int main() { int year=5;//定義存款年數year=5 double rate=0.0475,profit;//定義5年期按期存款利息rate爲4.75%,本息和爲profit profit=1000*(1+year*rate);//year年期本息和計算方法 printf("profit=%0.2lf\n",profit);
相關文章
相關標籤/搜索