国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

寫出一個程序,接受一個有字母和數字以及空格組成的字符串,和一個字符,然后輸出輸入字符串中含有該字符的個數。不區分大小寫.

2019-11-08 03:12:16
字體:
來源:轉載
供稿:網友
import java.util.Scanner;public class Main{    public static void main(String[] args){        Scanner sc = new Scanner (System.in);        String str1 = sc.nextLine();        String str2 = sc.nextLine();        find(str1,str2);            }        public static void find(String s1,String s2){        int count = 0;        s1 = s1.toLowerCase();        byte[] temp = s1.getBytes();        for(int i =0;i<temp.length;i++){            if(temp[i] == s2.toLowerCase().charAt(0)){                count++;            }        }               System.out.PRintln(count);    }}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 石首市| 卢龙县| 称多县| 论坛| 子长县| 阳曲县| 明光市| 乐安县| 策勒县| 长子县| 康平县| 德安县| 河曲县| 开原市| 葵青区| 泸水县| 贵阳市| 慈利县| 平罗县| 浪卡子县| 灵宝市| 广河县| 于都县| 丽江市| 从化市| 八宿县| 枣强县| 柯坪县| 资阳市| 锡林浩特市| 蛟河市| 成安县| 察隅县| 常宁市| 昌乐县| 铜梁县| 镇原县| 临漳县| 万宁市| 庄浪县| 庄浪县|