Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp21
- {
- class Program
- {
- static void Main(string[] args)
- {
- int sum = 0;
- int c = 0;
- int[,] array = new int[3, 3];
- for (int i = 0; i < 3; i++)
- for (int j = 0; j < 3; j++)
- array[i, j] = int.Parse(Console.ReadLine());
- Console.WriteLine("array is ");
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- Console.Write(array[i, j] + " ");
- Console.WriteLine();
- }
- //a
- Console.WriteLine();
- for (int i = 0; i < 3; i++)
- {
- c = array[i, 0];
- array[i, 0] = array[i, 2];
- array[i, 2] = c;
- }
- Console.WriteLine("array 2 is ");
- for( int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- Console.Write(array[i, j] + " ");
- Console.WriteLine();
- }
- for (int i = 0; i < 3; i++)
- {
- sum = 0;
- for (int j = 0; j < 3; j++)
- {
- sum = array[j, i] + sum;
- }
- Console.WriteLine("sumata e " + sum);
- }
- }
- }
- }
- //1
- //2
- //3
- //4
- //5
- //6
- //7
- //8
- //9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement