Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace fibonacci
- {
- class Program
- {
- public static void Main(string[] args)
- {
- int numberInput = int.Parse(Console.ReadLine());
- int breakPoint = (numberInput + 1);
- int numberCounter = 1;
- for (int currentRow = 1; currentRow <= numberInput; currentRow++)
- {
- for (int currentCol = 1; currentCol <= currentRow; currentCol++)
- {
- Console.Write("{0} ", numberCounter);
- numberCounter++;
- if (breakPoint == numberCounter)
- {
- break;
- }
- }
- Console.WriteLine("\n");
- if (breakPoint == numberCounter)
- {
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment