當前位置:編程學習大全網 - 網站源碼 - 怎麽用c來編壹個程序 輸入壹個字符串 輸出其中的tab和space數

怎麽用c來編壹個程序 輸入壹個字符串 輸出其中的tab和space數

調試通過。。。

#include<stdio.h>

void main()

{

char temp,temp2;

int count=0;

int count2=0;

while(temp!='\n')

{

temp=getchar();

if(temp=='\t')

{

count++;

}

if(temp=='\40')

{

count2++;

}

}

printf("TAB的個數為:%d\n",count);

printf("空格的個數為:%d\n",count2);

}

  • 上一篇:Oppo解鎖源代碼
  • 下一篇:美國ASP手槍
  • copyright 2024編程學習大全網