Advertisement
nikita_yashin

7(my)

Dec 14th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp5
  4. {
  5. class Program
  6. {
  7. static void Main()
  8. {
  9. var str = "asxd xsa";
  10. var result = "";
  11. for (int i = 0; i < str.Length; i++)
  12. {
  13. bool end = true;
  14. for (int j = i + 1; j < str.Length; j++)
  15. {
  16. if (str[i] == str[j])
  17. {
  18. result += str[i];
  19. end = false;
  20. break;
  21. }
  22. }
  23. if (end == true)
  24. break;
  25. }
  26. Console.WriteLine(result);
  27. Console.ReadKey();
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement