using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace bt_14
{
class Program
{
static int h, c;
static int[,] a;
static void nhap()
{
Console.Write("nhap so hang h=");h=int.Parse(Console.ReadLine());
Console.Write("nhap so cot c="); c = int.Parse(Console.ReadLine());
a=new int[h,c];
for(int i=0;i<h;i++)
for(int j=0;j<c;j++)
{
Console.Write("a[{0},{1}]=",i,j);
a[i,j]=int.Parse(Console.ReadLine());
Console.WriteLine();
}
}
static void hien()
{
Console.WriteLine("mang vua nhap la");
for (int i = 0; i < h; i++)
{
for (int j = 0; j < c; j++)
Console.Write(a[i, j] + "\t");
Console.WriteLine();
}
}
static void ktra()
{
int vth=0,vtc=0;
for (int i = 0; i < h; i++)
for (int j = 0; j < c; j++)
if (a[i, j] % 2 == 0)
{
vtc = j+1; vth = i+1;
}
Console.WriteLine("hang {0},cot {1}", vth, vtc);
}
static void Main(string[] args)
{
nhap();
hien();
ktra();
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace bt_14
{
class Program
{
static int h, c;
static int[,] a;
static void nhap()
{
Console.Write("nhap so hang h=");h=int.Parse(Console.ReadLine());
Console.Write("nhap so cot c="); c = int.Parse(Console.ReadLine());
a=new int[h,c];
for(int i=0;i<h;i++)
for(int j=0;j<c;j++)
{
Console.Write("a[{0},{1}]=",i,j);
a[i,j]=int.Parse(Console.ReadLine());
Console.WriteLine();
}
}
static void hien()
{
Console.WriteLine("mang vua nhap la");
for (int i = 0; i < h; i++)
{
for (int j = 0; j < c; j++)
Console.Write(a[i, j] + "\t");
Console.WriteLine();
}
}
static void ktra()
{
int vth=0,vtc=0;
for (int i = 0; i < h; i++)
for (int j = 0; j < c; j++)
if (a[i, j] % 2 == 0)
{
vtc = j+1; vth = i+1;
}
Console.WriteLine("hang {0},cot {1}", vth, vtc);
}
static void Main(string[] args)
{
nhap();
hien();
ktra();
Console.ReadKey();
}
}
}