Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- int[,] array = new int[4, 4];
- string s;
- for (int i = 0; i < 4; i++)
- {
- for (int j = 0; j < 4; j++)
- {
- array[i, j] = int.Parse(Console.ReadLine());
- }
- }
- Console.WriteLine();
- for (int i = 0; i < 4; i++)
- {
- s = "";
- for (int j = 0; j < 4; j++)
- {
- s += String.Format("{0,4}", array[i, j]);
- }
- Console.WriteLine(s);
- }
- int c;
- for (int i = 0; i < 3; i++)
- {
- for (int j = i+1; j < 4; j++)
- {
- c = array[i, j];
- array[i, j] = array[j, i];
- array[j, i] = c;
- }
- }
- Console.WriteLine();
- for (int i = 0; i < 4; i++)
- {
- s = "";
- for (int j = 0; j < 4; j++)
- {
- s += String.Format("{0,4}", array[i, j]);
- }
- Console.WriteLine(s);
- }
- /*
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement