desislava777

letterCombinacion

Dec 16th, 2017
704
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 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 ConsoleApplication2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. char a = char.Parse(Console.ReadLine());
  14. char b = char.Parse(Console.ReadLine());
  15. char c = char.Parse(Console.ReadLine());
  16. int combination = 0;
  17. for (char i=a; i<=b; i++)
  18. {
  19. for (char j=a; j<=b; j++)
  20. {
  21. for (char k=a; k<=b; k++)
  22. {
  23. if (i != c && j != c && k!=c)
  24. {
  25. Console.Write("{0}{1}{2} ", i, j, k);
  26. combination++;
  27. }
  28. }
  29. }
  30. }
  31. Console.Write(combination+" ");
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment