首页 > 题库 > 学历提升 > 自学考试 > 自考本科 > 编程题

阅读程序,描述该程序的输出结果。

import java.io.*;
public class Test30{ .
public static void main(String[] args) throws IOException{
InputSreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
String str=br.readLine();
int i, ditNo=0, upCharNo=0, loCharNo=0, otherCharNo=0;
for(i=0; i<str.length(); i++){
if(str.charAt(i)<='9' && str.charAt(i)>=’0’)
ditNo++;
else if(str.charAt(i)<=’Z’ && str.charAt(i)>='A')
upCharNo++;
else if(str.charAt(i)<=’z' && str.charAt(i)> ='a')
loCharNo++;
else otherCharNo++;
}
System.out .println("Nl="+ditNo+"\t",+"N2="+upCharNo); System.out.println("N3="+loCharNo+"\t"+"N4="+otherCharNo);
}
}

参考答案: 查看答案 查看解析 下载APP畅快刷题

相关知识点试题

相关试卷