求助 请问下面的程序错到哪里了 ?我找不到错误 无法编译 求指点
c语言吧
全部回复
仅看楼主
level 3
忆野狼 楼主
#include<stdio.h>
int is_num(char c)
{
if(c>='0'&&c<='9') return 1;
return 0;
}
int is_character(char c)
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) return 1;
return 0;
}
int main(int argc,char *argv[])
{
char ch='';
int c_num=0,c_char=0,c_other=0;
puts("请输入数据并以*结束");
printf("\n");
while (!('*'==ch))
{
ch=getche();
if(is_num(ch)) c_num++;
else
if(is_character(ch)) c_char++;
else
c_other++;
}
printf("\n%%%%",c_num,c_char,c_other);
getch(); }

2012年04月12日 01点04分 1
level 12
char ch='';
//不能这样写 没有这样的 char ch=0;
2012年04月12日 01点04分 2
level 9
抓头发。。。大声嚎叫、、、、撞墙!。。。。。。。。。
2012年04月12日 02点04分 3
level 4
你的引号是不是中文的~~
2012年04月12日 02点04分 4
level 12
额额额 你怎么了 ?
2012年04月12日 02点04分 5
level 10
问题是我经常这样写 不会出错啊
2012年04月12日 02点04分 6
level 12
你怎么写? 求代码
2012年04月12日 02点04分 7
level 7
else return 0;
2012年04月12日 02点04分 8
level 8
getche()
2012年04月12日 02点04分 9
level 10
2012年04月12日 03点04分 10
level 12
....
你这个是空格字符
LZ是 没有字符
能一样吗?
2012年04月12日 03点04分 11
level 9
一个对我来说、、浩大的工程啊!、、、[拍砖]、、、
2012年04月12日 03点04分 12
level 12
原来是这样 所以你 .....
哎 那是我逗小孩的 你还当真了
[瀑布汗~]
2012年04月12日 03点04分 13
level 9
啊?、、什么啊?、我没看帖子、我看到你才进来的、、、
、我是说、、、那个该死的驱动、、、那个该死的小球!、、
、、、对我来说、、浩大了!、、、
2012年04月12日 03点04分 14
level 12
哦哦 可怜的孩子
[安慰]
2012年04月12日 03点04分 15
1