import java.util.Scanner;
public class Solution {
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
System.out.print("输入要输入数组的行数:");
int a=scan.nextInt();
System.out.print("输入要输入数组的列数:");
int b=scan.nextInt();
int array[][]=new int [a][b];
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
array[i][j]=i*b+j;
System.out.print(array[i][j]);
System.out.print(" ");
}
System.out.println();
}
int k=scan.nextInt();
System.out.print("输入一个整数:" + k);
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
if(i==a-1&&j==b-1){
System.out.print("不存在该整数");
break;
}
else{
if(array[i][j]!=k){
continue;
}
if(array[i][j]==k){
System.out.print("存在该整数");
}
}}
}