?? max.java
字號:
public class max{
public static int max(int [] array){
if(array==null||array.length==0)
throw new IllegalArgumentException("無效數組");
int index=1,location=0;
while (index<array.length){
if(array[location]<array[index])location=index;
index++;
}
return array[location];
}
public static void main(String argv[])
{ int a[]={1,2212,44,45,454,77,887878};
max max1=new max();
max1.max(a);
System.out.println(max1.max(a));
int ap=1,result=0;
while(true) {
result+=ap++;
if(ap==101)break;
System.out.println(result);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -