當前位置:編程學習大全網 - 電腦編程 - 幫忙編程啊,C語言

幫忙編程啊,C語言

//---------------------------------------------------------------------------

#include <stdio.h>

#include <ctype.h>

int main(void)

{

int i,num=0,alp=0,ot=0;

char ch;

for (i = 0; i<20; i++) {

ch=getchar();

if (isalpha(ch)) alp++;

else if (isdigit(ch)) num++;

else ot++;

}

printf("數字:%d\n字母:%d\n其它:%d\n",num,alp,ot);

return 0;

}

//---------------------------------------------------------------------------

  • 上一篇:電腦的內存是可以編程控制的嗎,比如編程在內存裏存入什麽什麽數據,還是只能給cpu用的
  • 下一篇:用VB畫等腰三角形
  • copyright 2024編程學習大全網