View Code of Problem 3924

#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#define N 100
using namespace std;
int main()
{
	char a,b;
	while((a=getchar())!=EOF)
	{
		if(a!=b)
			printf("%c",a);
		b=a;
	}
    /*char str[1000000];
    int i=0;
    scanf("%s",str);
    printf("%c",str[0]);
    for(int i=1;i<strlen(str);i++)
    {
    	if(str[i]==str[i-1])
    		continue;
    	else
    		printf("%c",str[i]);	
	}*/
}

Double click to view unformatted code.


Back to problem 3924