View Code of Problem 3924

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<map>
#include<string>
#include<set>
using namespace std;
int main(void){
	string str;
	int t=0;
	getline(cin,str);
	char temp;
	for(int i=1;i<str.length();i++,t++){
		temp=str[t];
		if(str[i]==temp)
			continue;
		else
			cout<<temp;	
	}
	cout<<str[str.length()-1];
}

Double click to view unformatted code.


Back to problem 3924