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 ConsoleApp41
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[7, 2];
- int i, j, br = 0, P = 0;
- for (i = 0; i < 7; i++)
- for (j = 0; j < 2; j++)
- array[i, j] = int.Parse(Console.ReadLine());
- for (i = 0; i < 7; i++)
- {
- for (j = 0; j < 2; j++)
- Console.Write(array[i, j] + " ");
- Console.WriteLine();
- }
- /*
- for (i = 0; i < 7; i++)
- for (j = 0; j < 2; j++)
- {
- br = 0;
- if (array[i, 0] > 0 && array[i, 1] > 0)
- br++;
- }
- Console.WriteLine("broqt na usporednicite " + br);
- */
- for (i = 0; i < 7; i++)
- for (j = 0; j < 2; j++)
- {
- br = 0;
- if (array[i, 0] > 0 && array[i, 1] > 0)
- P = P + array[i, 0] + array[i, 1];
- }
- Console.WriteLine("p = " + P);
- }
- }
- }
- /*
- 0
- 1
- -4
- -1
- 1
- 1
- 10
- 5
- 11
- 11
- 3
- 2
- 1
- 4
- */
Add Comment
Please, Sign In to add comment