Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _1.Shockwave
  8. {
  9.     class Program
  10.     {
  11.         static void Main()
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             int m = int.Parse(Console.ReadLine());
  15.             int[,] primary = new int[n, m];
  16.             string input = Console.ReadLine();
  17.  
  18.  
  19.             while (input != "Here We Go")
  20.             {
  21.  
  22.                 string[] coordinates = input.Split(' ');
  23.                 int x1 = int.Parse(coordinates[0]);
  24.                 int y1 = int.Parse(coordinates[1]);
  25.                 int x2 = int.Parse(coordinates[2]);
  26.                 int y2 = int.Parse(coordinates[3]);
  27.                 for (int i = x1; i <= x2; i++)
  28.                 {
  29.                     for (int j = y1; j <= y2; j++)
  30.                     {
  31.                         primary[i, j]++;
  32.                     }
  33.  
  34.                 }
  35.                 input = Console.ReadLine();
  36.                
  37.             }
  38.             for (int i = 0; i < n; i++)
  39.             {
  40.                 for (int j = 0; j < m; j++)
  41.                 {
  42.                     Console.Write(primary[i, j]);
  43.                 }
  44.                 Console.WriteLine();
  45.             }
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement