using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Math
{
public class Program
public static void Main(string[] args)
bool yes=true;
string s = "";
int q = 0;
int M, N;
Console.WriteLine("Введите m:");
M = int.Parse(Console.ReadLine());
Console.WriteLine("Введите n:");
N = int.Parse(Console.ReadLine());
int[,] m = new int[M,N];
for (int i = 0; i < M; i++)
for (int j = 0; j < N; j++)
Console.Write("[{0},{1}] : ",i,j);
m[i, j] = int.Parse(Console.ReadLine());
s += m[i, j] + "\t";
if (yes & m[i, 0] != m[i, j]) yes = false;
}
if (yes) q++;
s += "\n";
yes = true;
Console.WriteLine(s+"\nответ : "+q+" строк");
Console.ReadKey(true);
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Math
{
public class Program
{
public static void Main(string[] args)
{
bool yes=true;
string s = "";
int q = 0;
int M, N;
Console.WriteLine("Введите m:");
M = int.Parse(Console.ReadLine());
Console.WriteLine("Введите n:");
N = int.Parse(Console.ReadLine());
int[,] m = new int[M,N];
for (int i = 0; i < M; i++)
{
for (int j = 0; j < N; j++)
{
Console.Write("[{0},{1}] : ",i,j);
m[i, j] = int.Parse(Console.ReadLine());
s += m[i, j] + "\t";
if (yes & m[i, 0] != m[i, j]) yes = false;
}
if (yes) q++;
s += "\n";
yes = true;
}
Console.WriteLine(s+"\nответ : "+q+" строк");
Console.ReadKey(true);
}
}
}