Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Problem_04b
- {
- class Program
- {
- static void Main()
- {
- //Alternate Solution
- string[] inputElements = Console.ReadLine().Split(' ').ToArray();
- for (int i = 0; i < inputElements.Length; i++)
- {
- Console.Write(inputElements[i]);
- if (i < inputElements.Length-1 && (inputElements[i] == inputElements[i+1]))
- {
- Console.Write(" ");
- }
- else
- {
- Console.WriteLine();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement