Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- Queue<int> q = new Queue<int>();
- int n = 3;
- int count = int.Parse(Console.ReadLine());
- q.Enqueue(n);
- for (int i = 0; i < count; i++)
- {
- int num = q.Dequeue();
- Console.Write("{0} ", num);
- q.Enqueue(num + 1);
- q.Enqueue(2 * num + 1);
- q.Enqueue();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement