⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 max.java

📁 这一些程序都是实验之用
💻 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 + -