Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int w = int.Parse(Console.ReadLine());
- int k = int.Parse(Console.ReadLine());
- int[,] macierz = new int[w,k];
- int c = 0;
- for (int z = 0; z < w; z++)
- {
- for (int v = 0; v < k; v++)
- {
- macierz[z, v] = int.Parse(Console.ReadLine());
- }
- }
- for (int x = 0; x < w; x++)
- {
- for (int y = 0; y < k; y++)
- {
- Console.Write(macierz[x, y] + "\t");
- if (macierz[x, x] == 1)
- {
- if (macierz[x, y] == 0)
- {
- c++;
- }
- }
- }
- Console.WriteLine();
- }
- if (c == (macierz.Length - w))
- {
- Console.WriteLine("Macierz jednostkowa");
- }
- else
- {
- Console.WriteLine("Macierz nie jest jednostkowa");
- }
- Console.WriteLine(w);
- Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement