标签:查找 ext byte 一个 public 类型 ase ack lse
switch(expression){
case value1:
break;
case value2:
break;
default:
}
for(int i:arrays[10]){
}
outer: for(int i=101;i<150;i++){
for(;;){
if(flag) continue outer;
}
}
public static void f(int n){
if(n==1){
return 1;
}
else{
return n*f(n-1);
}
}
int[] a = {1, 2, 3};
Man[] mans = {new Man(1,1),new Man(2,2)};
int[][] b = {{1,2},{2,3},{3,4}};
int[] a = new int[2];
Arrays(array,0);
Arrays(array,fromIndex:2,toIndex:4,val0)//类似于python切片
boolean flag;
for (int i = 0; i < n-1; i++) {
flag = false;
for (int j = 0; j < n-i-1; j++) {
//
//
//
flag=true;
}
if(!flag){
break;
}
}
//原数组
int[][] array1 = new int[11][12];
array1[3][5] = 12;//4行6列
array1[5][2] = 32;//6行3列
array1[7][8] = 84;//8行9列
int sum=3;
//创建稀疏数组
int[][] array2 = new int[sum+1][3];
array2[0][0] = 11;//11行
array2[0][1] = 12;//12列
array2[0][2] = sum;//sum个有效值
int count = 0;
for (int i = 0; i < array1.length; i++) {
for (int j = 0; j < array1[i].length; j++) {
if(array1[i][j]!=0){
count++;
array2[count][0]=i;
array2[count][1]=j;
array2[count][2]=array1[i][j];
}
}
}
for (int i = 1; i < array2.length; i++) {
System.out.println(array2[i][0]+"\t"+array2[i][1]+"\t"+array2[i][2]);
System.out.println("");
}
//还原数组
int[][] array3 = new int[array2[0][0]][array2[0][1]];
for (int i = 1; i < array2.length; i++) {
array3[array2[i][0]][array2[i][1]]=array2[i][2];
}
for (int[] ints:array3) {
for (int anInt:ints) {
System.out.print(anInt+"\t");
}
System.out.println("");
}
标签:查找 ext byte 一个 public 类型 ase ack lse
原文地址:https://www.cnblogs.com/guanlisir/p/14403289.html