當前位置:編程學習大全網 - 編程軟體 - 編程輸入壹個字符,輸出九個字符。

編程輸入壹個字符,輸出九個字符。

公共類數組文件{

靜態掃描儀sc =新掃描儀(system . in);

公共靜態void main(String[] args) {

地圖& ltInteger,Integer & gtmap = new HashMap & ltInteger,Integer & gt();

for(int I = 0;我& lt10;i++) {

map.put(i,0);

}

字符串s = null

while (true) {

system . out . println(" Please enter:");

s = sc . nextline();

if (Pattern.matches("^[0-9]*$),s){

打破;

}

}

char[]a = s . tochararray();

for (char cc:a) {

integer in = integer . parse int(cc+" ");

map.put(in,map . get(in)+1);

system . out . println(in);

}

system . out . println(map);

}

}

  • 上一篇:SDK是壹款軟件還是插件!~或者是其他什麽?
  • 下一篇:軟件開發如何賺錢?
  • copyright 2024編程學習大全網