CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include<cstring>
using namespace std;
//Compiler version g++ 6.3.0
int main()
{
char str[100];
cin.getline(str,100);
for(int i=0,j=1;i<strlen(str);i++,j++)
{
if(str[i]==str[j])
cout<<str[i];
else
cout<<str[i]<<endl;
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run