Advertisement
SonGokuBg

Untitled

Feb 13th, 2020
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace LettersCombination
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. char startLetter = char.Parse(Console.ReadLine());
  10. char endLetter = char.Parse(Console.ReadLine());
  11. char exceptLetter = char.Parse(Console.ReadLine());
  12.  
  13. var sum = 0;
  14. for (char first = startLetter; first <= endLetter; first++)
  15. {
  16. for (char second = startLetter; second <= endLetter; second++)
  17. {
  18. for (char third = startLetter; third <= endLetter; third++)
  19. {
  20. if (first != exceptLetter && second != exceptLetter && third != exceptLetter)
  21. {
  22. sum++;
  23. Console.Write("{0}{1}{2} ", first, second, third);
  24.  
  25. }
  26.  
  27. }
  28. }
  29. }
  30. Console.Write(sum);
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement