标题:排队取钱
取消只看楼主
gemlong
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-11-22
结帖率:100%
已结贴  问题点数:10 回复次数:0 
排队取钱
哪里出错了?
#include<stdio.h>

int main()
{
    int save,member,line,money[100],i,j,sum=0;
    while(printf("请输入ATM里的钱数:"),scanf("%d",&save)!=EOF)
    {
         
        printf("请输入排队人数:");
        scanf("%d",&member);
        printf("请输入大河排在第几位:");
        scanf("%d",&line);
        printf("每个人要取的钱数分别为:\n");
        for(i=0;i<member;i++)
        {
            scanf("%d",&money[i]);
        }
        for(j=0;j<line;j++)
        {
            sum+=money[j];
        }
        if(save<sum)
        {
        printf("大河不能取到钱\n\n");
        }
        else
        {
        printf("大河能取到钱\n\n");
        }
    }
}
搜索更多相关主题的帖子: include member money 
2014-12-05 16:15



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




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

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