View Code of Problem 3924

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main() {
	char a[1000000000];
	gets(a);
	int flag = 1;
	int len = strlen(a);
	for (int i = 0; i < len-1; i++)
	{
		if (a[i]==a[i+1])
		{
			flag = 0;
		}
		else
		{
			flag = 1;
		}
		if (flag==1)
		{
			printf("%c", a[i]);
		}	
	}
	printf("%c",a[len-1]);
	


	return 0;
}

Double click to view unformatted code.


Back to problem 3924