标题:[求助]这个程序怎么退出来?
取消只看楼主
suifengjita
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2006-10-12
 问题点数:0 回复次数:0 
[求助]这个程序怎么退出来?

#include<stdio.h>
#define OUT 0
#define IN 1

main()
{
int index,c,ns,nl,nw;
ns=nl=nw=0;
index=OUT;
while((c=getchar())!=EOF)
{
++ns;
if(c=='\n')
++nl;
if(c==' '||c=='\n'||c=='\t')
index=OUT;
else if (index == OUT)
{
index=IN;
++nw;
}
}
printf("%d %d %d",ns,nl,nw);

}

这个程序没法跳出来啊,加限制条件也不行!!
而且我觉得这个程序有点问题,如果遇到2个单词之前是很多空格就不行了

搜索更多相关主题的帖子: OUT index define 
2006-11-30 09:08



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




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

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