已采纳回答 / qq_慕丝2451907
public class HelloWorld { public static void main(String[] args) { // 定义一个整型数组,并赋初值 int[] nums = new int[] { 61, 23, 4, 74, 13, 148, 20 }; int max = nums[0]; // 假定最大值为数组中的第一个元素 int min = nums[0]; // 假定最小值为数组中的第一个元素 double sum = 0;// ...
2017-05-02
已采纳回答 / 慕粉1509062320
String [][] names={{"tom","jack","mike"},{"zhangsan","lisi","wangwu"}};这样子就好了。
2017-05-01
已采纳回答 / 南柯一梦_
public class HelloWorld { public static void main(String[] args) { // 定义一个数组,保存五名学生的成绩 int[] scores = { 78, 93, 97, 84, 63 }; // 输出数组中的第二个成绩 System.out.println("数组中的第2个成绩为:" +scores[1]); }}<...code...>
2017-05-01
已采纳回答 / LooMing_Hou
首先条件判断num%3!=0;不要放在for循环条件里,那样到了false的时候会跳出整个for循环,你应该另起一行用if来判断条件并且用continue返回for循环,还有你应该输出sum而不是numpublic static void man(String[] args){ int sum=0; for(int num=1;num<=100;num++){ if(num%3==0){ continue; } sum+=n...
2017-05-01
已采纳回答 / qq_海阔天空_134
String[][] names=new String[2][]; names[0]=new String[2];//new String[2]意思是第一行有2列 names[1]=new String[5]; names[0][1]="lisi";//所以这里的names[0][1]指的就是第一行第二列 你写的names[0][2]是第一行第三列的,但是你只为第一行分配了2列 names[1][4]="wangwu"; System.out.println(names[0][1]); Sys...
2017-04-29