Advertisement
g-stoyanov

ExamC# 29.12.2012 Task2

Dec 29th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System;
  2.  
  3. class Task2
  4. {
  5.     static void Main()
  6.     {
  7.         Int64 input0 = int.Parse(Console.ReadLine());
  8.         Int64 input1 = int.Parse(Console.ReadLine());
  9.         Int64 input2 = int.Parse(Console.ReadLine());
  10.         Int64 input3 = int.Parse(Console.ReadLine());
  11.         Int64 rows = int.Parse(Console.ReadLine());
  12.         Int64 cols = int.Parse(Console.ReadLine());
  13.         Int64[] output = new Int64[rows * cols];
  14.         int check = 0;
  15.         output[0] = input0;
  16.         output[1] = input1;
  17.         output[2] = input2;
  18.         output[3] = input3;
  19.         for (int i = 4; i < rows * cols; i++)
  20.         {
  21.             output[i] = output[i - 4] + output[i - 3] + output[i - 2] + output[i - 1];
  22.         }
  23.         while(check < rows * cols)
  24.         {
  25.             for (int x = 0; x < cols; x++)
  26.             {
  27.                 Console.Write(output[check] + " ");
  28.                 check++;
  29.             }
  30.             Console.WriteLine();
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement