首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

帮忙看一下这个程序错哪啦~多谢

2012-02-05 
帮忙看一下这个程序错哪啦~~谢谢#includestdio.h #defineMAXLEN80intmain(){intcount,i,kcharch,oldch,

帮忙看一下这个程序错哪啦~~谢谢
#include   "stdio.h "
#define   MAXLEN   80
int   main(   )
{     int   count,i,k;
      char   ch,oldch,str[MAXLEN];
      oldch= '   ';
      while((ch=getchar())!= '# '||oldch!= '# '){
            k=0;
            while(ch!= '# '&&   k <   MAXLEN-1){
          str[k++]=ch;
          ch=getchar();
            }
            oldch= '# ';
            str[k]= '\0 ';
            count=0;

            for(i=0;i <k;i++)
            if(str[i]> 'A '&&str[i] < 'Z ')
if(str[i]!= 'A '&&str[i]!= 'I '&&str[i]!= 'E '&&str[i]!= 'O '&&str[i]!= 'U ')
  count++;
            if(ch== '# '&&oldch== '# ')
            printf( "%d\n ",count);
      }
}

[解决办法]
写得好乱啊

热点排行