我是靠谱客的博主 可爱石头,这篇文章主要介绍二维数组操作,现在分享给大家,希望可以做个参考。

import java.util.Scanner;


public class OperateArray {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int row = scan.nextInt();
		int colum = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int d = scan.nextInt();
		int e = scan.nextInt();
		int f = scan.nextInt();
		int g = scan.nextInt();
		int h = scan.nextInt();
		print("0");
		if((a < row && a >= 0 && b < colum  && b >= 0)&&
				(c < row && c >= 0 && d < colum  && d >= 0))
			print("0");
		else 
			print("-1");
		
		if(e < row && e >= 0)
			print("0");
		else 
			print("-1");
		
		if(f < colum && f >= 0)
			print("0");
		else 
			print("-1");
		
		if(g < row && g >= 0 && h < colum  && h >= 0)
			print("0");
		else 
			print("-1");
	}

	private static void print(String str) {
		System.out.println(str);
	}

}

最后

以上就是可爱石头最近收集整理的关于二维数组操作的全部内容,更多相关二维数组操作内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部