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 MoyaConsoleApp
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] a =
- {
- {1 ,4 ,5 ,1 ,3},
- {1 ,1 ,5 ,3 ,1},
- {3 ,5 ,1 ,5 ,3},
- {5 ,1 ,3 ,5 ,1},
- {7 ,1 ,1 ,5 ,7}
- };
- int s = 0;
- int g = 0;
- for (int i = 0; i < a.GetLength(0); i++)
- {
- for (int j = 0; j < a.GetLength(0); j++)
- {
- if (a[i, j] % 2 == 0)
- g = j;
- }
- s = s + a[i, g];
- }
- Console.WriteLine(s);
- Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement