第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

這個(gè)邏輯性,不好理解能解釋下面。大神???感謝------

這個(gè)邏輯性,不好理解能解釋下面。大神???感謝------

qq_小杜_(tái)1 2017-06-09 23:17:17
題目:輸入一行字符,分別統(tǒng)計(jì)出其中英文字母、空格、數(shù)字和其它字符的個(gè)數(shù)。import java.util.*;public class lianxi07 {public static void main(String[] args){int digital = 0;int character = 0;int other = 0;int blank = 0;char[] ch = null;Scanner sc = new Scanner(System.in);String s = sc.nextLine();--------------------------------------------下面的邏輯不太理解-----------------------------------------------ch = s.toCharArray();for(int i=0; i<ch.length; i++) {if(ch >= '0' && ch <= '9') {digital ++;} else if((ch >= 'a' && ch <= 'z') || ch > 'A' && ch <= 'Z') {character ++;} else if(ch == ' ') {blank ++;} else {other ++;}}---------------------------------------------------------------------------------------------------------------------System.out.println("數(shù)字個(gè)數(shù): " + digital);System.out.println("英文字母?jìng)€(gè)數(shù): " + character);System.out.println("空格個(gè)數(shù): " + blank);System.out.println("其他字符個(gè)數(shù):" + other );}}
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關(guān)注
  • 1939 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)