Advertisement
n4wn4w

2zadacha20dekemvriChestSHeats

Mar 19th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.42 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int rows = int.Parse(Console.ReadLine());
  13.             int cols = int.Parse(Console.ReadLine());
  14.             long vNumber = int.Parse(Console.ReadLine());
  15.             long hNumber = int.Parse(Console.ReadLine());
  16.  
  17.             for (long row = vNumber; row < vNumber + rows; row++)// da natrupva s gornoto
  18.             {
  19.                 for (long col = hNumber; col < hNumber + cols; col++)
  20.                 {
  21.                     Console.Write(row * col + " ");
  22.  
  23.                     //  if (col < hNumber + cols - 1)
  24.                     //  {
  25.                     //       Console.Write(' ');
  26.                     //  }
  27.                 }
  28.                 Console.WriteLine();
  29.             }
  30.         }
  31.     }
  32. }
  33.  
  34.  2 RESHENIE ///////////////////////////////////////////////////////////////////////////////////////
  35.  
  36. int rows = int.Parse(Console.ReadLine());
  37. int columns = int.Parse(Console.ReadLine());
  38. long verticalStart = int.Parse(Console.ReadLine());
  39. long horizontalStart = int.Parse(Console.ReadLine());
  40.  
  41.  
  42. for (int i = 0; i < rows; i++)
  43. {
  44.  for( int j = 0; j < columns; j++)
  45.   {
  46.    long currentValue = (verticalStart + i)*(horizontalStart + j);
  47.    Console.Write(currentValue + " ");
  48.   }
  49. Console.Writeline();
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement