Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Enumerable.Range(0, int.Parse(Console.ReadLine())).Aggregate(new List<int>(), (l, n) => { l.Add(n); return new List<int>(l); }, l => { var list = new List<KeyValuePair<int, int>>(); l.ForEach(e => list.Add(new KeyValuePair<int, int>(l.Max(), e))); return list; }).ForEach(kvp => { Console.WriteLine("{0}{1} | {1}", new string(' ', (kvp.Key - kvp.Value)), new string('*', kvp.Value)); });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement