Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class CheatSheet
- {
- static void Main()
- {
- int row = int.Parse(Console.ReadLine());
- int col = int.Parse(Console.ReadLine());
- long horizontalStart = long.Parse(Console.ReadLine());
- long verticalStrat = long.Parse(Console.ReadLine());
- long[,] matrix = new long[row,col];
- long start = horizontalStart * verticalStrat;
- for (long i = 0, vertStep = start; i < row; i++, vertStep +=verticalStrat)
- {
- for (long j = 0, horizStep = vertStep; j < col; j++, horizStep +=horizontalStart)
- {
- matrix[i, j] = horizStep;
- }
- horizontalStart++;
- }
- for (long i = 0; i < row; i++)
- {
- for (long j = 0; j < col; j++)
- {
- Console.Write("{0} ",matrix[i,j]);
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement