【问题】 设有数组定义:int MyIntArray[ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70}; 则执行以下几个语句后的输出结果是() 。 int s = 0; for (int i = 0; i < MyIntArray.length;i + + ) if ( i % 2 = = 1 ) s += MyIntArray[i] ; System.out.println(s);

设有数组定义:int MyIntArray[ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70}; 则执行以下几个语句后的输出结果是() 。 int s = 0; for (int i = 0; i < MyIntArray.length;i + + ) if ( i % 2 = = 1 ) s += MyIntArray[i] ; System.out.println(s);

正确答案:正确答案为: 120

题目解析:本题出自石家庄铁道大学,石家庄铁道大学面向对象程序设计,由丰阳塔题库搜集整理。