欧美色欧美亚洲高清在线观看,国产特黄特色a级在线视频,国产一区视频一区欧美,亚洲成a 人在线观看中文

  1. <ul id="fwlom"></ul>

    <object id="fwlom"></object>

    <span id="fwlom"></span><dfn id="fwlom"></dfn>

      <object id="fwlom"></object>

      輸入一行字符,分別統(tǒng)計(jì)出其中英文、空格、數(shù)字和其他字符的個(gè)數(shù)

      時(shí)間:2019-05-13 16:14:09下載本文作者:會(huì)員上傳
      簡(jiǎn)介:寫(xiě)寫(xiě)幫文庫(kù)小編為你整理了多篇相關(guān)的《輸入一行字符,分別統(tǒng)計(jì)出其中英文、空格、數(shù)字和其他字符的個(gè)數(shù)》,但愿對(duì)你工作學(xué)習(xí)有幫助,當(dāng)然你在寫(xiě)寫(xiě)幫文庫(kù)還可以找到更多《輸入一行字符,分別統(tǒng)計(jì)出其中英文、空格、數(shù)字和其他字符的個(gè)數(shù)》。

      第一篇:輸入一行字符,分別統(tǒng)計(jì)出其中英文、空格、數(shù)字和其他字符的個(gè)數(shù)

      #include

      int main()

      {char ch;int A=0,B=0,C=0,D=0;

      printf(“A(字符)B(空格)C(數(shù)字)D(其它):n”);

      printf(“請(qǐng)輸入一串字符:”);

      while((ch=getchar())!='n')

      {if('a'<=ch && ch<='z' || 'A'<=ch && ch<='Z')A=A+1;

      else if('0'<=ch&&ch<='9')C=C+1;

      else if(ch==' ')B=B+1;

      else D=D+1;

      }

      printf(“英文字母、空格、數(shù)字、其他字符的個(gè)數(shù)分別為:%d,%d,%d,%dn”,A,B,C,D);return 0;

      }

      第二篇:C#中鍵盤(pán)輸入一串字符,輸出該字符包含字母、數(shù)字個(gè)數(shù)

      using System;

      using System.Collections.Generic;using System.Linq;

      using System.Text;

      namespace study

      {

      class Program

      {

      static void Main(string[] args){

      {

      {

      numberSum=}

      {

      smallSum=}

      {

      bigSum=}

      {

      elseSum=}

      }

      }

      }

      }

      Console.WriteLine(“請(qǐng)輸入字符:”);string a = Console.ReadLine();int numberSum=0,smallSum=0,bigSum=0,elseSum=0;for(int i = 0;i < a.Length;i++)if(a[i] >= 48 && a[i] <= 57)numberSum+1;else if(a[i] >= 97 && a[i] <= 122)smallSum+1;else if(a[i] >= 65 && a[i] <= 90)bigSum+1;else elseSum+1;Console.WriteLine(“數(shù)字有{0}個(gè)”, numberSum);Console.WriteLine(“小寫(xiě)字母有{0}個(gè)”, smallSum);Console.WriteLine(“大寫(xiě)字母有{0}個(gè)”, bigSum);Console.WriteLine(“其他有{0}個(gè)”, elseSum);

      第三篇:c語(yǔ)言編程 有一篇文章共有3行文字每行80個(gè)字符要求分別統(tǒng)計(jì)出其中英文字母數(shù)字空

      C語(yǔ)言編程 有一篇文章,共有3行文字,每行80個(gè)字符。要求分別統(tǒng)計(jì)出其中英文字母,數(shù)字,空...2種做法,1種用單字符來(lái)讀取輸入,1種用字符串來(lái)讀取輸入。1.#include int main(){ int i, upper, lower, digit, space, other;char c;upper = lower = digit = space = other = 0;for(i = 0;i < 3;i++)getchar())!= 'n')

      while((c =

      if('A' <= c && c <= 'Z')

      else if('a' <= c &&

      else if('0' <= c

      else if(c == upper++;

      c <= 'z')lower++;

      && c <= '9')' ')space++;

      digit++;

      else other++;printf(“upper:%dnlower:%dndigit:%dnspace:%dnother:%dn”, upper, lower, digit, space, other);return 0;} 2.#include int main(){ int i, j, upper, lower, digit, space, other;char str[3][81];upper = lower = digit = space = other = 0;for(i = 0;i < 3;i++){

      for(j = 0;str[i][j];j++)

      gets(str[i]);

      if('A' <= str[i][j]

      upper++;&& str[i][j] <= 'Z')

      else if('a' <= str[i][j] && str[i][j] <= 'z')lower++;

      else if('0' <= str[i][j] &&

      digit++;

      else if(str[i][j] == ' ')str[i][j] <= '9')

      space++;

      else

      other++;}printf(“upper:%dnlower:%dndigit:%dnspace:%dnother:%dn”, upper, lower, digit, space, other);return 0;}提問(wèn)人的追問(wèn)

      2009-05-02 11:48

      “for(j = 0;str[i][j];j++)”這一句沒(méi)有限制條件吧!是不是應(yīng)該寫(xiě)成“for(j=0;str[i][j]!='