SHARE
TWEET

Untitled

a guest Nov 21st, 2019 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace replaceRepeatingChars
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string input = Console.ReadLine();
  10.             for (int i = 0; i < input.Length - 1; i++)
  11.             {
  12.                 if (input[i] == input[i + 1])
  13.                 {
  14.                     input = input.Remove(i + 1, 1);
  15.                     i--;
  16.                 }
  17.             }
  18.             Console.WriteLine(input);
  19.         }
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top