Advertisement
iliqnvidenov

Untitled

Jan 28th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. class CheatSheet
  6. {
  7.     static void Main()
  8.     {
  9.         int row = int.Parse(Console.ReadLine());
  10.         int col = int.Parse(Console.ReadLine());
  11.         long horizontalStart = long.Parse(Console.ReadLine());
  12.         long verticalStrat = long.Parse(Console.ReadLine());
  13.         long[,] matrix = new long[row,col];
  14.         long start = horizontalStart * verticalStrat;
  15.         for (long i = 0, vertStep = start; i < row; i++, vertStep +=verticalStrat)
  16.         {
  17.             for (long j = 0, horizStep = vertStep; j < col; j++, horizStep +=horizontalStart)
  18.             {
  19.                 matrix[i, j] = horizStep;
  20.             }
  21.             horizontalStart++;
  22.         }
  23.  
  24.         for (long i = 0; i < row; i++)
  25.         {
  26.             for (long j = 0; j < col; j++)
  27.             {
  28.                 Console.Write("{0} ",matrix[i,j]);
  29.             }
  30.             Console.WriteLine();
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement