Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class TribonacciTriangle
- {
- static void Main()
- {
- long first = long.Parse(Console.ReadLine());
- long second = long.Parse(Console.ReadLine());
- long third = long.Parse(Console.ReadLine());
- byte L = byte.Parse(Console.ReadLine());
- for (int i = 0; i < L; i++)
- {
- for (int j = 0; j <= i; j++)
- {
- long newNum = first + second + third;
- if (j > 0)
- {
- Console.Write(' ');
- }
- Console.Write(first);
- first = second;
- second = third;
- third = newNum;
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement