标题:各位大侠帮我看看这段程序哪里错了
只看楼主
菜鸟小天
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-3-13
 问题点数:0 回复次数:0 
各位大侠帮我看看这段程序哪里错了
#include<stdio.h>
#include<windows.h>
int main()
{
    float principal,rate,interest;
    int days;
    printf("enter loan principal (-1 to end):");
    scanf("%f",&principal);
    while(principal!=-1)
    {printf("enter interest rate:");
     scanf("%f",&rate);
     printf("enter term of the loan in days:");
     scanf("%f",&days);
     interest=(float)principal*rate*days/365;
     printf("the interest charge is:$%.2f\n",interest);
     printf("enter loan principal (-1 to end):");
     scanf("%f",&principal);}
     system("pause");
     return 0;}
不管输入什么数怎么输出都是31124214.00呀
搜索更多相关主题的帖子: principal interest include charge 
2008-03-13 11:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-203185-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.192880 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved