我是靠谱客的博主 可爱石头,最近开发中收集的这篇文章主要介绍二维数组操作,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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);
	}

}

最后

以上就是可爱石头为你收集整理的二维数组操作的全部内容,希望文章能够帮你解决二维数组操作所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部