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 ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] matrix = new int[10, 10];
- int n = int.Parse(Console.ReadLine());
- List<int> coordinates = new List<int>();
- int counterInput = 0;
- int marker = 0;
- int input;
- while (counterInput <= 2 * n - 1)
- {
- input = int.Parse(Console.ReadLine());
- coordinates.Add(input);
- counterInput++;
- }
- int matrixDraw = 0;
- for (int i = 0; i < 2 * n - 1; i++)
- {
- if (i % 2 == 0)
- {
- int x = coordinates[i];
- int y = coordinates[i + 1];
- if (y == 9)
- {
- y = 0;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 8)
- {
- y = 1;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 7)
- {
- y = 2;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 6)
- {
- y = 3;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 5)
- {
- y = 4;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 4)
- {
- y = 5;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 3)
- {
- y = 6;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 2)
- {
- y = 7;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 1)
- {
- y = 8;
- matrix[x, y] = 1;
- continue;
- }
- if (y == 0)
- {
- y = 9;
- matrix[x, y] = 1;
- continue;
- }
- }
- }
- for (int i = 0; i < matrix.GetLength(0); i++)
- {
- for (int j = 0; j < matrix.GetLength(1); j++)
- {
- Console.Write(matrix[i,j]);
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment