Anonimka

Untitled

Nov 3rd, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 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 exam
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. char last = char.Parse(Console.ReadLine());
  14. int seats = int.Parse(Console.ReadLine());
  15. char oddseats =char.Parse(Console.ReadLine());
  16. char c = Convert.ToChar(50 + oddseats);
  17. int sectorCount = 0;
  18. int seatsCount = 0;
  19.  
  20. for(char a='A';a<=last;a++)
  21. {
  22. sectorCount++;
  23. if(sectorCount>1)
  24. {
  25. seats++;
  26. }
  27. for (int i = 1; i <= seats; i++)
  28. {
  29. if (i!= 1 &&i % 2 == 0)
  30. {
  31. for (char b = 'a'; b <c; b++)
  32. {
  33. Console.WriteLine($"{a}{i}{b}");
  34. seatsCount++;
  35. }
  36. }
  37. else
  38. {
  39. for (char b = 'a'; b < c; b++)
  40. {
  41. if (b == 'c' || b == 'd')
  42. {
  43. break;
  44. }
  45. Console.WriteLine($"{a}{i}{b}");
  46. seatsCount++;
  47. }
  48. }
  49. }
  50. }
  51. Console.WriteLine(seatsCount);
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment