Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Diagnostics;
  7.  
  8. namespace rekursia_Masha
  9. {
  10.     class Program
  11.     {
  12.        
  13.         static void Main(string[] args)
  14.         {
  15.             Stopwatch swatch = new Stopwatch();
  16.             swatch.Start();
  17.             chisla();
  18.             swatch.Stop();
  19.             Console.WriteLine(swatch.Elapsed);
  20.         }
  21.  
  22.         static void chisla(int kod = 65, int kol_vo = 80, int count = 0)
  23.         {
  24.            
  25.             for (int i = 0; i <= kol_vo; i++)
  26.             {
  27.                 Console.Write(Convert.ToChar(kod));
  28.             }
  29.             Console.WriteLine();
  30.            
  31.             if (count != 25)
  32.             {
  33.                 chisla(kod + 1,kol_vo - 2, count + 1);
  34.             }
  35.  
  36.             else if (kol_vo != 80)
  37.             {
  38.                 chisla(kod - 1, kol_vo + 2, count);
  39.             }
  40.  
  41.            
  42.            
  43.         }
  44.     }
  45.  
  46.    
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement