《JAVA 程序设计》复习题之(三)阅读程序题三、程序阅读题1.阅读以下程序import java
*;public class Reverse2 { public static void main(String args[ ]){int i,n=10; int a[] = new int[10]; try { BufferedReader br = new BufferedReader( new InputStreamReader(System
in)); a[i] = Integer
parseInt(br
readLine() ); } catch (IOException e) { }; for (i= n-1; i >= 0; i=i-2)System
print(a[i]+" "); System
println();}}请写出该程序的功能:该程序使用字符缓冲输入流从键盘输入 10 个数,然后倒序并间隔打印出来
2.阅读以下程序import java
* ;public class abc { public static void main(String args[ ]) { int i, s = 0 ; int a[] = { 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120 }; for ( i = 0 ; i< a
length ; i++ )if (i % 3 == 0) s += a[i];System
println("s=" + s);}}请写出该程序的输出结果:s=2603、阅读以下程序:import java
*;public class TestRandomAccess { public static void main(String args[]) { in