Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- StringBuilder sb = new StringBuilder();
- string str = Console.ReadLine();
- int i = 0, j = 0;
- while (str[j] == ' ')
- j++;
- while (j<str.Length)
- {
- if (str[j] != ' ')
- {
- sb.Append(str[j]);
- j++;
- }
- else
- {
- while (j < str.Length && str[j] == ' ')
- j++;
- if(j != str.Length)
- sb.Append(' ');
- }
- }
- Console.WriteLine(sb+ "/");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement