Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- long firstNum = long.Parse(Console.ReadLine());
- long secondNum = long.Parse(Console.ReadLine());
- long thirdNum = long.Parse(Console.ReadLine());
- long forthNum = long.Parse(Console.ReadLine());
- int rows = int.Parse(Console.ReadLine());
- int cols = int.Parse(Console.ReadLine());
- long result = 0
- if (cols == 4)
- {
- Console.WriteLine(firstNum + " " + secondNum + " " + thirdNum + " " + forthNum);
- }
- else
- {
- Console.Write(firstNum + " " + secondNum + " " + thirdNum + " " + forthNum + " ");
- }
- for (int i = 0; i < rows; i++)
- {
- int currentCols = 0;
- if (i == 0)
- {
- currentCols = 4;
- }
- for (int y = currentCols; y < cols; y++)
- {
- resut = firstNum + secondNum + thirdNum + forthNum;
- firstNum = secondNum;
- secondNum = thirdNum;
- thirdNum = forthNum;
- forthNum = result;
- if (y + 1 == cols)
- {
- Console.WriteLine(result);
- }
- else
- {
- Console.Write(reuslt + " ");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement