ss3434

6.Сватбени_места

Oct 23rd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 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.  
  7. namespace _6.Сватбени_места
  8.  
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. string posledenSektor = Console.ReadLine();
  15. int broiRedoveNa1Sektor = int.Parse(Console.ReadLine());
  16. var broiMestaNe4etenRed = int.Parse(Console.ReadLine());
  17.  
  18. char ch = char.Parse(posledenSektor);
  19. string f = broiMestaNe4etenRed.ToString();
  20. char ch1 = char.Parse(f);
  21. int count = 0;
  22. int sum = 0;
  23.  
  24. for (char i = 'A'; i <= ch; i++)
  25. {
  26. if (i>97)
  27. {
  28. broiRedoveNa1Sektor+=1;
  29. }
  30. for (int j = 1; j <= broiRedoveNa1Sektor; j++)
  31. {
  32.  
  33. if (j % 2 == 0)
  34. {
  35.  
  36. for (char k = 'a'; k <= 'd'; k++)
  37. {
  38. Console.WriteLine($"{i}{j}{k} ");
  39. sum++;
  40. }
  41. }
  42. else
  43. {
  44. for (char k = 'a'; k <= 'b'; k++)
  45. {
  46. Console.WriteLine($"{i}{j}{k} ");
  47. sum++;
  48. }
  49. }
  50.  
  51. }
  52. }
  53. Console.WriteLine(sum);
  54. }
  55. }
  56. }
Add Comment
Please, Sign In to add comment