當前位置:編程學習大全網 - 網站源碼 - c語言編程問題

c語言編程問題

#include<stdio.h>

void main()

{

for(;;)

{

float bj,lx=0,ll,d;

printf("輸入本金:");

scanf("%f",&bj);

printf("輸入年利率:");

scanf("%f",&ll);

printf("輸入借貸天數:");

scanf("%f",&d);

if(ll==-1) break;

else

{

lx=bj*ll*d/365;

printf("利息是:%f\n\n",lx);

continue;

}

}

}

利率是小數表示的的,比如說20%那麽直接輸入0.2,別輸入20

  • 上一篇:如何在網頁右鍵屬性裏屏蔽查看源代碼或使查看源代碼變為灰色?
  • 下一篇:易語言怎麽寫,使用某個程序來運行其他文件
  • copyright 2024編程學習大全網