我给你改了一点,见下面的程序*********************************************#include<stdio.h>main() {char ch;int x = 0, y = 0;loop1:while(1){ ch = getchar(); if(ch >= '1' && ch <= '9') { x++; goto loop1; } else if(ch >= 'a' && ch <= 'z' || ch>='A' && ch<='Z') { y++; goto loop1; } else if(ch != '*') goto loop1; else break;}printf("number(s):%d\tletter(s)%d", x ,y);system("pause");}*****************************************这个应该可以达道你的要求
void main(){ char ch; int x=0,y=0; ch='q'; while((ch=getchar())!='*'){ if(ch>='1' && ch<='9') x++; if(ch>='a' && ch<='z' || ch>='A' && ch<='Z') y++; }printf("number(s):%d\tletter(s)%d",x,y);}