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