simeon3000

Tricky Strings

Jun 6th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1.             string delimiter = Console.ReadLine();
  2.             int n = int.Parse(Console.ReadLine());
  3.  
  4.             string lastInput = string.Empty;
  5.             string result = string.Empty;
  6.  
  7.             for (int i = 0; i < n; i++)
  8.             {
  9.                 string input = Console.ReadLine();
  10.  
  11.                 if (i != n - 1) result += input + delimiter;
  12.  
  13.                 else lastInput = input;
  14.             }
  15.  
  16.             Console.WriteLine(result + lastInput);
Advertisement
Add Comment
Please, Sign In to add comment