我是靠谱客的博主 着急长颈鹿,这篇文章主要介绍12.06作业4,现在分享给大家,希望可以做个参考。

package javadome3;

public class Text12 {

	public static void main(String[] args) {
		// 在一个有8个整数(18,25,7,36,13,2,89,63)的数组中找出其中最大的数及其下标
		//(知识点:数组遍历、数组元素访问) [必做题]
		int [] arr = new int [] {18,25,7,36,13,2,89,63};
		int max = arr[0];int i = 1;
		for( i  = 1;i <arr.length;i++){
			if( max < arr[i]){
				max = arr[i];
			}
		}
		System.out.println("最大值"+max);
		System.out.println(i-1);
}
}

最后

以上就是着急长颈鹿最近收集整理的关于12.06作业4的全部内容,更多相关12内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(133)

评论列表共有 0 条评论

立即
投稿
返回
顶部