View Code of Problem 3924

#include<stdio.h>
#include<math.h>
#include<string.h>
//#include<algorithm>
//#include <bits/stdc++.h>

using namespace std;

int main() {
	char last=getchar(),now;
	printf("%c",last);
	while(now=getchar()) {
		if(now==EOF) {
			break;
		}
		if(now==last) {

		} else {
			printf("%c",now);
			last=now;
		}
	}
}

Double click to view unformatted code.


Back to problem 3924