fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace laba1 {
  5. class Program {
  6. static void Main(string[] args) {
  7. var n = int.Parse(Console.ReadLine());
  8. Enumerable.Range(0, n).Select(x => {
  9. var ch = x%2==0?'+':'*';
  10. return new string(Enumerable.Repeat(' ', (n-x)).ToArray())
  11. + new string (Enumerable.Repeat(ch, 2*x+1).ToArray());
  12. }).ToList().ForEach(x => Console.WriteLine(x));
  13. Console.ReadKey();
  14. }
  15. }
  16. }
  17.  
Success #stdin #stdout 0.03s 23964KB
stdin
6
stdout
      +
     ***
    +++++
   *******
  +++++++++
 ***********