阅读背景:

在C语言中究竟是什么\ r \ n?

来源:互联网 
#include <stdio.h>

int main()
{
  int countch=0;
  int countwd=1;

  printf("Enter your sentence in lowercase: ");
  char ch='a';
  while(ch!='\r')
  {
    ch=getche();
    if(ch==' ')
      countwd++;
    else
      countch++;
  }

  printf("\n Words =%d ",countwd);

  printf("Characters = %d",countch-1);

  getch();
}
#include <stdio.h>

int main()
{
  int countch=



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: