fork download
  1. using System;
  2. using System.Linq;
  3. namespace q218309203
  4. {
  5. class Program
  6. {
  7. public static string cleanStr(string str) {
  8. string r = "";
  9. foreach (char c in str) {
  10. if (char.IsLetterOrDigit(c))
  11. r += c;
  12. else if (r.Length > 0 && r[r.Length - 1] != ' ')
  13. r += ' ';
  14. }
  15. return r;
  16. }
  17. public static void Main(string[] args)
  18. {
  19. Console.WriteLine(String.Join(" ", cleanStr(Console.ReadLine()).Split(' ').Distinct().ToArray()));
  20. Console.ReadKey(true);
  21. }
  22. }
  23. }
Success #stdin #stdout 0.02s 17460KB
stdin
          ddd,     sss     aaa:ddd:ghjf dkskks aaa re
stdout
ddd sss aaa ghjf dkskks re