semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main (){
	char a[300],b[300];
	int i,j,n;
	gets(a);
	n=strlen(a);
	j=0;
		for(i=0;i<=n;i++){
		if(a[i]!=' '){
			b[j]=a[i];
			j++;
		}
		else if(a[i]==' '&&a[i+1]!=' '){
			b[j]=a[i];
			j++;
		}
		else if(a[i]=='\0')
                            b[j]=a[i];
	}
	printf("%s",b);

	return 0;
}
int main()
{
	char jz[100];
	cin.getline(jz,100,'\n');
	int gs=strlen(jz);
	int i;
	for(i=0;i<=gs-1;i++)
	{
		if(jz[i]!=' ')
		cout<<jz[i];
		else break;
	}//?????????? 
	for(i;i<=gs-1;i++)
	{
		if(jz[i]!=' '&&jz[i-1]==' ')
		{
			cout<<' '<<jz[i];
	    }
	    else if(jz[i]!=' '&&jz[i-1]!=' ')
	    cout<<jz[i];
	}//??????????????? 
return 0;
}
//************************
//*????????? **
//*?????? **
//*???1200012957 **
//*???2012-12-09 **
//************************

void moveforward(char *p)
{
	for( ; *p != '\0'; p++ )
	{
		*p = *(p + 1);
	}
}

int main ()
{
	char str[100];
	cin.getline(str, 100);
	char *p = str;
	for ( ; *p != '\0'; p++ )
	{
		if (*p == ' ' && *(p - 1) == ' ')
		{
			moveforward(p);
			p-- ;
		}
	}
	cout << str << endl;
    
	return 0;
}
int main(){
	char zfc[210];
	gets(zfc);
	int len=strlen(zfc);
	for(int k=0;k<len-1;k++){
		if((zfc[k]!=32)||((zfc[k]==32)&&(zfc[k+1]!=32))){
			printf("%c",(zfc[k]));
		}
		else if((zfc[k]==32)&&(zfc[k+1]==32)){
			printf("%c",(zfc[k]));
			while(zfc[k]==32){
				k++;
			}
			k--;
		}
	}
	printf("%c",(zfc[len-1]));
	return 0;
}
//******************
//**???????**
//*?? 1100012915**
//******11.29*******
//******************

int main() 
{ 
char start[200], result[200]; //????????
char *p = NULL ;			//????
int i = 0, j ;
cin.getline( start ,200);	//??????
for ( p = start; *p != '\0'; p ++ ) 
{ 
	if( ( *p != ' ') || ( *( p + 1 ) != ' ' ) )//????????????????????????
		cout << *p ;		//??
}
return 0;
}
int main()
{
    char sh[1000],ch[500]={0},temp[500];
    int n,m,i,j=0,k;
    gets(sh);
    n=strlen(sh);
    for(i=0; i<n; i++)
    {

        if(sh[i]!=' ')
        {
            ch[j]=sh[i];
            j=j+1;
        }
        if(sh[i]==' ')
        {
            if(sh[i-1]==' ')
                continue ;
            if(sh[i-1]!=' ')
                ch[j]=' ';
                 j=j+1;
        }
    }

    printf("%s",ch);
    return 0;
}
int main(){
    char juzi[200];   
    int i,j,m;
    gets(juzi);
    m=strlen(juzi);
    for(i=1;i<m-1;i++){
        if(juzi[i-1]!=' '&&juzi[i]==' '&&juzi[i+1]==' '){
            for(j=i+1;j<m-1;j++){
                juzi[j]=juzi[j+1];
            }
            m=m-1;
            juzi[m]='\0';
            i--;
        }
    }
    puts(juzi);
    return 0;
}
int main()
{
	char d;
    while((d=getchar())!=EOF)
	{
		printf("%c",d);
		if(d==' ')
		{
			for(;;)
			{
				if((d=getchar())==' ')continue;
				else 
				{
                    printf("%c",d);
					break;
				}
			}
		}
	}
	return 0;
}
//****************************************
//*???????                      **
//*??? 1100012927              **
//*2011.11.29                     **
//****************************************
void f(char *);
int main()
{
    char n[50];
    char *p;
    cin.getline(n, 50);
    p = n;
    f(p);
        return 0;
}
void f(char *p)
{
    if (*p == '\0')
    {
        return;
    }
    
    
    if (*p != ' ')
    {
        cout << *p;
        f(++p);
    }
    else if(*(p + 1) != ' ')
    {
        cout << *p;
        f(++p);
    }
    else
        f(++p);
}
int main() {
	int del = 0;
	char word[100];
	cin.getline(word, 100);
	int len = strlen(word);
	for (int i = 1; i < len; i++)
		if (*(word + i) == ' ' && *(word + i - 1) == ' ') //????
		{
			del++; //?????????1
			for (int j = i; j < len - del; j++) //?????????
				*(word + j) = *(word + j + 1);
			i--; //?????????
		}
	for (int k = 0; k < len - del; k++) //?????????
		cout << *(word + k);
	return 0;
}
int main()
{
	char a[200];
	gets(a);
    int len;
	len=strlen(a);
	for(int i=0;i<len;i++)
	{
		if(a[i]!=' ')printf("%c", a[i]);
		else if(a[i]==' ' && a[i+1]!=' ') printf(" ");
	}
	 return 0;
}
int main()
{
int i,l,j=1;
char a[1000],b[1000]={'0'};
gets(a);
l=strlen(a);
b[0]=a[0];
for(i=1;i<l;i++){
if(a[i]==' '){
if(a[i+1]!=' '){
b[j]=a[i];
j++;
}
continue;
}else{
b[j]=a[i];
j++;
}
}
printf("%s",b);
return 0;
}
int main()
{int i,l,j;
	char s[1000];
	gets(s);
	l=strlen(s);
	for (i=0;i<l;i++)
	{if (s[i]==' '&&s[i-1]==' ')
	{
		for (j=i;j<l-1;j++)
		{
			s[j]=s[j+1];
		}
		l=l-1;i=i-1;
		}
	}
		for (i=0;i<l;i++)
	{printf("%c",s[i]);
	}	
		return 0;
}
int main()
{
	int i,j,l;
	char s[210];
	gets(s);
	l=strlen(s);
	j=0;
	for(i=0;i<l;i++)
	{
		if(s[i]==' ')
		{
			if(j==0)
			{
				printf("%c",s[i]);
				j++;
			}
		}
		else
		{
			printf("%c",s[i]);
			j=0;
		}
	}
	return 0;
}
int main(){
	char str[101][101];
	int n=1;
	char (*p)[101]=NULL;
	while(cin>>str[n])n++;
	for(p=str+1;p<str+n-1;p++){
		cout<<*p<<" ";
	}
	cout<<*p;
	return 0;
}
int main(){
   int i,j=0;
   char s[201],m[201]={0};
   gets(s);
   for(i = 0; s[i]!='\0'; i++){
    if ((s[i]!=' ')||((s[i]==' ')&&(s[i+1]!=' '))){
      m[j]=s[i];
      j++;
   }
   }
   puts(m);
   return 0;
 }
int main()
{
	char c;
	int f=1;
	while ((c=getchar())!=EOF)
	{
		if (c!=' ')
		{
			cout<<c;
			f=1;
		}//deal with words

		else if (f) {
			cout<<c;
			f=0;
		}//deal with space
	}
	return 0;
}
int main()
{
	char a[100], *p = a, *q;
	cin.getline(a, 100);
	while (*p != '\0')
	{
		q = p; 
		if (*p == ' ' && *(p + 1) == ' ')
		{
			for (; *p != '\0'; p++)
				*p = *(p + 1);
			p = q;
		}
		else
			p++;
	}
	cout << a << endl;
	return 0;
}
int main()
{
 	char zfc[1000],s[1000];
 	int length,i,num=0;
 	gets(zfc);
 	length=strlen(zfc);
 	for(i=0;i<length;i++){
		if(i==0){
			s[num]=zfc[i];
			num++;
			}
		else{
			if(zfc[i]!=' '||(zfc[i]==' '&&zfc[i-1]!=' '))
			{
				s[num]=zfc[i];
				num++;
				}
			}
		}
	for(i=0;i<num;i++){
		printf("%c",s[i]);
		}
    return 0;
}
int main()
{char *s;
int i,j,flag;
s=(char*)malloc(100000*sizeof(char));
gets(s);
for(i=0;*(s+i)!='\0';i++)
{if(*(s+i)==' ')  
   { if(flag==0) {for(j=i;*(s+j)!='\0';j++) *(s+j)=*(s+j+1);i--;} flag=0;}
 else flag=1;
}
puts(s);
	
	}
/*************************************************************************************************************
* @file .cpp
* @author ????
* @date 
* @description
*         ???????
*/


int main()
{
	char w[1000];
	int i = 0, j = 0, flag = 1, l;
	cin.getline(w, 1000);
	l = strlen(w);
	for(i = 0; i < l; i++)
	{
		if(w[i] != 32) 
			flag = 1;
		if(flag)
			cout << w[i];
		if(w[i] == 32)
			flag = 0;
	}
	return 0;
}
int main()
{
	int i;
	char *s;
	s=(char *)malloc(sizeof(char)*1000);
	gets(s);
	for(i=0;*(s+i)!='\0';i++)
	{
		if(*(s+i)!=' ') printf("%c",*(s+i));
		else
		{
			while(*(s+i+1)==' ') i++;
			printf("%c",*(s+i));
		}
	}
	printf("\n");
	return 0;
}
int main(){
	char a[100];
	int n,i;
	gets(a);
	for(i=0;a[i]!='\0';i++){
		if(i==0)printf("%c",a[i]);
		else if(a[i-1]==' '&&a[i]!=' ')
			printf(" %c",a[i]);
		else if(a[i]!=' ')printf("%c",a[i]);
	}
	
	return 0;
}
int main()
{
	int i;
	char a[250]={','};
	gets(a);
    for(i=0;i<200;i++)
	{
		if(a[i]>=65&&a[i]<=(65+26)||a[i]>=97&&a[i]<=(97+26)||a[i]=='.')
		{
			printf("%c",a[i]);
		}
		else if(a[i]==' ')
		{
			if(a[i+1]!=' ')
			{
	           printf("%c",a[i]);
			}
		}
		else
		{
			continue;
		}
	}
	return 0;
}
int main(){
	int i,a;
	char z[300];
	gets(z);
	a=strlen(z);
    for(i=0;i<a;i++){
		
		if(z[i]!=' '){
			printf("%c",z[i]);
			continue;
		}
		if(z[i]==' '&&z[i+1]!=' '){
			printf("%c",z[i]);
			continue;
		}
	}
    return 0;
}
int main()
{
char a[1000],b[1000];
	int i,j=0,n=0;
    gets(a);
  for(i=0;a[i]!='\0';i++)
  {
	  if(a[i]==' '&&n==0)

	  {
     b[j]=a[i];
	 n=1;
	 j++;
	  }
    else if (a[i]!=' ')
	{
		n=0;
		b[j]=a[i];
		j++;
  }
  }
  b[j]='\0';
	printf ("%s",b);
 

return 0;
}
int main()
{
	char sentence[100] ;
	int i ,len,flag[100]={0};
	cin.getline(sentence,100);
	len=strlen(sentence);
	for(i=0;i<len;i++)
		if (sentence[i]==' '&&sentence[i+1]==' ') flag[i+1]=1;
	for(i=0;i<len;i++)
		if(flag[i]==0) cout<<sentence[i];
	return 0 ;
}
/*
 * XIV3.cpp
 *
 *  Created on: 2012-12-9
 *      Author:???
 *      ??????????
 */
int main() {
	int j, i;
	char a[1000][100];//??????????
	for (i = 0; i < 1000; i++) {
		cin >> *(a + i);
		if(getchar()=='\n') break;
	}//????????????
	cout<<*(a);
	for(j=1;j<=i;j++)
		cout<<" "<<*(a+j);//?????????????
}
int main()
{
	char a[201];
	cin.getline(a,201);
	int n=strlen(a);
	
	char *p=a;
	int i=1;
	while(i<=n)
	{
		if(*p!=' ')
		{
		cout<<*p;
		p++;
		i++;
		}
		else 
		{
			cout<<' ';
			while(*p==' ')
			{
				p++;
				i++;
			}
		}
	}
	
	return 0;
}
int main()
{
	char a[100] = {'\0'};
	char *p;
	cin.get(a, 100, '\n');
	p = a;
	for (int i = 0; a[i] != '\0'; i++)
	{
		if (a[i] == ' ')
		{
			while (a[i + 1] == ' ')
			{
				for (int l = i + 1; a[l] != '\0'; l++)
					*(p + l) = *(p + l + 1);
			}
		}
	}
	cout << a;
	return 0;
}
int main()
{
    char a[50];
    int flag = 1;
    cin.getline(a, 50);
    char *p = a;
    for (p = a; *p != '\0'; p++)
    {
        if (flag)
            cout << *p;
        if (*p == ' ' )
            flag = 0;
        if (*(p +1) != ' ' )
                flag = 1;
    }
    cout << endl;
    return 0;
}
/*
 * ???????????.cpp
 * ??????
 * ?????2012.11.10
 * ??????????
 */
int main() {
	char str[10000];
	cin.getline(str, 10000);
	int i, j;
	for (i = 0; i < strlen(str); i++) {
		if (str[i] != ' ') {
			cout << str[i];
			continue;
		} else {
			for (j = i + 1; j < strlen(str); j++) {
				if (str[j] != ' ')
					break;
			}
			cout<<" ";
			i=j-1;
		}
	}
	return 0;
}
int main(){
	int i,n,j;
	char yjh[1][LEN];
	gets(yjh[0]);
	n=strlen(yjh[0]);
	for(i=0;i<n;i++){
		if(yjh[0][i]==32 && yjh[0][i+1]==32){
			for(j=i;j<n;j++){
				yjh[0][j]=yjh[0][j+1];
				i--;
			}

	}
	}
	printf("%s\n",yjh[0]);
	return 0;
}
//**********************************************************
//*  ?????1.cpp                                       *
//*  ??????1200012906                                *
//*  ???2012?12?3?                                   *
//*  ????????????                              *
//**********************************************************

int main()
{
	int flag = 0;
	char str[100], *p = NULL;
	cin.getline(str,100);
	for (p = str; *p != '\0'; p++)  //????
	{
		if (*p == ' ')   //?????
		{
			if (flag == 1)   //??????????????
				continue;
			else       //????????????
			{
				cout << *p;
				flag = 1;
			}
		}
		else     //???????????????????
		{
			cout << *p;
			flag = 0;
		}
	}
	cout << endl;
	return 0;
}
int main()
{
	char str[10000];
	char *r, *w;
	r = w = NULL;
	cin.getline(str,10000,'\n');
	r = w = str;
	while(*r != '\0')
	{
		*w = *r;
		if(*r == ' ')
		{
			while(*r == ' ')
				r++;
			r--;
		}
		w++;r++;
	}
	*w = '\0';
	cout << str << endl;
	return 0;
}
int main()
{
	
	char s[100], *p;
	int i, l;
	p = s;
	cin.getline(s, 100);
	l = strlen(s);
	int sum = l;
	for (i = 0;i < l;i++)
	{
		if (p[i] == ' ')
		{
			if (p[i - 1] == ' ')
			{
				int k = i;
				while (p[i] == ' ')
					i++;
				for (int j = k;j < l - (i - k);j++)
					p[j] = p[j + i - k];
				if (i <= sum)
					sum = sum - (i - k );
				i = k ;
			}
		}
	}
	for (i = 0;i < sum;i++)
		cout << p[i];

	return 0;
}
int main(){
	int i,l,k,b;
	char zfc[1000];
	
	b=0;
	gets(zfc);
	l=strlen(zfc);
	for(i=0;i<l-1;i++){
		if(zfc[i]==' '&&zfc[i+1]==' '){
			for(k=i+1;k<l-1;k++){
				zfc[k]=zfc[k+1];
			}
			i--;
			b++;
		}
	}
	if(b!=0){
		zfc[l-b]=0;
	}
    printf("%s",zfc);

return 0;
}
//*********************************
//*?????????            **
//*?????? 1100012914       **
//*???2011?11?26?          **
//*********************************


int main()
{
	char sen1[10000], sen2[10000] = {'0'}, *p, *q;
	int len, i, j = 0;

	cin.getline(sen1, 10000);
	len = strlen(sen1);
	for (i = 0; i < len; i++)
	{
		if (sen1[i] != ' ' || (sen1[i] == ' ' && sen1[i + 1] != ' '))
		{
			p = &sen1[i];
			sen2[j++] = *p;
			p++;
		}
	}
	len = strlen(sen2);
	for (i = 0; i < len; i++)
		cout << sen2[i];
	return 0;
}
int main()
{
  char in[10001]={0};
  int i,len;
  cin.get(in,1000);
  len=strlen(in);
  for (i=0;i<=len-1;i++)
    {
      if ((in[i]==' ')&&(in[i+1]==' ')) continue;//????????????????????????????????? 
      cout<<in[i];                    
    }    
  return 0;
}
int main()
{
	char a[1002];
	int i,j;
	for(i=1;i<=1000;i++)
		a[i]=' ';
	for(i=1;i<=1000;i++)
	{
		scanf("%c",&a[i]);
		if(a[i]=='\n')
			break;
	}
	for(i=1;i<=1000;i++)
		if(a[i]!=' ')
		{
			printf("%c",a[i]);
			break;
		}
	for(j=i+1;j<=999;j++)
	{
		if((a[j]!=' '||(a[j]==' '&&a[j+1]!=' '))&&(a[i]>=32&&a[i]<=122))
			printf("%c",a[j]);
	}
	return 0;
}
int main(){
    int i,k=0;
    char a[100],b[100]={'\0'};
    gets(a);
    b[0]=a[0];
    for(i=1;a[i]!='\0';i++){
        if((a[i]==' ')&&(a[i-1]==' ')){
            ;
        }else{
            k++;
        }
        b[k]=a[i];
    }
    puts(b);
    return 0;
}
int main()
{
	int n;char a[100];char *p;    //???????????????
	cin.getline(a,100);           //???????
	n=strlen(a);                  //???????
	p=a;
	while(*p==' ')                //????????????
	{
		p=p+1;
	}
	cout << *p;                   //??????????
	p++;
	for(p;p<a+n;p++)              //????????????????????
	{
		if(*(p-1)!=' '||*p!=' ')
			cout << *p;
	}
	return 0;
}
int main(int argc, char* argv[])
{
   char str[250];
   int i,j,n;
   gets(str);
   for(i=0;i<strlen(str);i++)
   {
	 if(str[i]!=' ')  printf("%c",str[i]);
	 if(str[i]==' '&&str[i+1]!=' ')  printf(" ");
   }
	   
	return 0;
}
int main(){
    char sen[MAX][MAX]={0};
	int i,e;
    for(i=0;i<MAX;i++){
		scanf("%s",sen[i]);
	}
	for(i=0;i<MAX;i++){
		if(sen[i][0]==0){
			e=i;
			break;
		}
	}
	printf("%s",sen[0]);
	for(i=1;i<e;i++){
		printf(" %s",sen[i]);
	}
	return 0;
}
/*??????
 *?????zhizhen3.cpp
 *Created on: 2012-12-10
 *???????
 */
int main (){
	char *t;char cha[500];int i;               //???????
	cin.getline (cha,500);                     //???????
	t=cha;
	for (i=0;*(t+i)!='\0';i++)
	{if ((*(t+i)==' ')&&(*(t+i+1)==' '))
		continue;
	else cout << *(t+i);                       //????
	}
	cout << endl;
	return 0;                                  //????
}
int main(){
  char s[1100];
  int i,j;
  for (i=0;scanf("%s",s)!=EOF;i++)
    printf("%s%s",i==0?"":" ",s);
  printf("\n");
  return 0;
}
main()
{
	char *p;
	int k=0;
	p=(char*)malloc(300*sizeof(char));
	gets(p);
	for(;*p!='\0';p++)
	{
		if(*p==' '&&k!=0)
			continue;
		if(*p==' '&&k==0)
			k++;
		if(*p!=' ')
			k=0;
		putchar(*p);
	}
}
main()
{
      int i,j,count;
      char a[300]={'\0'};
      gets(a);
      for(i=0;i<300;i++)
      {
                        if(a[i]=='\0')break;
                        else if(a[i]!=' ')
                        {
                                   printf("%c",a[i]);
                                   count=0;
                        }
                        else if(count==0 && count==0)
                        {
                             printf(" ");count++;
                        }
      }
}
int main() {
	char a[100], b[100];
	cin.getline(a, 100);
	char *p1, *p2;
	int len = strlen ( a );
	p2 = b;
	for ( p1 = a; p1 <= a + len - 1; p1 ++) {
		if ( * p1 != ' ' ) * ( p2 ++ ) = * p1;
		else if ( * p1 == ' ' && * ( p1 + 1 ) != ' ' ) * ( p2 ++ ) = ' ';
	}
	* p2 = '\0';
	cout << b << endl;
	return 0;
}
int main()
{
	char s[300];
	gets(s);
	int i, l;
	int flag = 1;
	l = strlen(s);
	for (i = 0; i < l; i++)
	{
		if (s[i] != ' ')
		{
			printf("%c", s[i]);
			flag = 1;
		}
		else if (s[i] == ' ')
		{
			if (flag == 0)
				continue;
			else
			{
				printf("%c", s[i]);
				flag = 0;
			}
		}
	}
	putchar('\n');
	return 0;
}
int main(){
    char u[1000];
    int n,i,j,c,b=0;
    gets(u);
    n=strlen(u);
    
    for(i=1;i<n-1;i++){
    c=0;         
    while(1){
   
    if(u[i]==32&&u[i+1]==32){
    for(j=i;j<n-2;j++){
    u[j+1]=u[j+2];     
    }
    c++;
          }
         
    if((u[i]==32&&u[i+1]!=32)||u[i]!=32)
          break; 
          }
           b=b+c;
          } 
                
                
for(i=0;i<n-b;i++){   
printf("%c",u[i]);
}

return 0;  
}
int main()
{
	char a[100], i = 0, j;
	while (cin.get(a[i]))
	{
		if (a[i] == '\n')
			break;
		if ((a[i] == a[i - 1]) && (a[i] == 32))
			i--;
		i++;
	}
	for (j = 0; j <= i; j++)
		cout << a[j];
return 0;
}
int main(){
	int j,i,n;
    char s[380];
	gets(s);
    printf("%c",s[0]);
	for(i=1;s[i];i++){
		if(s[i-1]==' '&&s[i]==' '){
			continue;
		}else{
			printf("%c",s[i]);
		}
	}
	return 0;
}
int main()
{
	char c;
	int n=0;
	while((c=getchar())!='\n')
	{
		if(c==' ')
		{
			if(n==0)//?n????????
			{cout<<' ';n++;}
			else
			{n++;}
		}
		else
		{
			cout<<c;
			n=0;
		}
	}
		return 0;
	}
char a[100];
int i;
void sf()
{
     int l = strlen(a);
     char *p = a;
     for(p = a, i = 0; i < l; p++, i++)
     {
             if(*p!=' '||(a[i]==' '&& *(p + 1)!=' ')) 
             {
                 cout << a[i] ;
             }
     }
     return ;
}     
int main()
{
    cin.getline(a,100);
    sf();
    cin >> a;
    return 0;
}
int main() {
	char str[201];
	gets(str);
	int i, l = strlen(str);
	for (i = 0; i < l; i++) {
		if (!(i > 0 && *(str+i) == ' ' && *(str+i-1) == ' ')) {
			printf("%c", *(str+i));
		}
	}
	return 0;
}
int main()
{
	char c[1000];
	int l;
	cin.getline(c,1000);
	l=strlen(c);
	for(int i=0;i<l;i++)
	{
		if((c[i]==' ')&&(c[i]==c[i+1]))
		{
			for(int j=i;j<l-1;j++)
			{
				c[j]=c[j+1];
			}
			l--;
			i--;
		}
	}
	for(int i=0;i<l;i++)
	{
		cout<<c[i];
	}
	return 0;
}
int main()
{
	char zifu[300],tihuan[300];
	int k,i=0;
	gets(zifu);
	for(k=0;k<strlen(zifu);k++)
	{
		if((zifu[k]!=' ')||(zifu[k]==' '&&zifu[k+1]!=' '))
		{
		   tihuan[i]=zifu[k];
		   i++;
		}
        else
		{
		   continue;
		}
	}
	for(k=0;k<i;k++)
	{
	printf("%c",tihuan[k]);
    }
	return 0;
}
int main(){
    int i,j;
char zf[110],sz[110];
gets (zf);
int l=strlen(zf);
zf[l]=' ';
zf[l+1]='\0';
for(i=0,j=0;i<l;i++){
	if((zf[i]==' ')&&(zf[i+1]==' '))
		continue;
sz[j]=zf[i];
j++;
}
sz[j]='\0';
 puts(sz);
return 0;
}
void work(char*);
int main()
{                    
 	char *p, s[101];          //????p?????????s
	cin.getline(s, 100);
	p = s;                    //??????????p
	for(; *p != '\0'; p++)    //????'\0'
	{
		if(*p == ' ')         //???????
		{
			if(*(p + 1) == ' ')  //??????????
			{
				work(p);
				p--;
			}
		}
	}
	p = s;
	cout << p;
	return 0;
}
void work(char *p)
{
	for(;; p++)
	{
		*p = *(p + 1);
		if(*p == '\0')
			break;
	}
	return;
}
int main(){
	int i=0,m,cd,q[100],z[100],b;
	char dc[100]={'0','0','0'};
	  gets(dc);
       cd=strlen(dc);
	for(m=0;m<cd;m++){
   if(m==0||(dc[m-1]==' '&&dc[m]!=' '))q[i]=m;
   if(((dc[m]==' '||dc[m]==','||dc[m]=='.')&&(dc[m-1]!=' '&&dc[m-1]!=','&&dc[m-1]!='.'))||m==cd-1){z[i]=m;i=i+1;}
  }
	for(m=0;m<i;m++){
		for(b=q[m];b<=z[m];b++){
       printf("%c",dc[b]);
		}
	}
	  return 0;
}
int main() {
	char a[100][100];
	int n;
	for(int i = 0; i < 100; i ++){
		cin >> a[i];
		char q = getchar();
		if(q == '\n'){//????????
			n = i + 1;
			break;
		}
	}
	cout << a[0];
	for(int k = 1; k < n; k ++)
		cout << " " << a[k];
	return 0;
}
int main()
{
char str1[100],str2[100];
int len,i,t=1;
gets(str1);
len=strlen(str1);
str2[0]=str1[0]; 
for(i=1;i<len;i++){
if(str1[i]!=' '||str1[i-1]!=' '){
str2[t]=str1[i];
t++;
}
}
str2[t]='\0';
puts(str2);
return 0;
}
int main()
{
   char ch[200],s[200];
   int m,i,j=0,word=0;
   gets(ch);
   m=strlen(ch);
   for(i=0;i<m;i++)
   {
      if(ch[i]!=' ')
      {
         s[j]=ch[i];
         j++;
         word=1;	
      }	
     else if(word==1)
      {
          word=0;
          s[j]=ch[i];
          j++;	
      }
   }
   puts(s);
   return 0;
}
int main()
{
	int i = 0;
	char c[100];
	char *p;
	cin.getline(c,100);
	cout << c[0];
	for(p = c + 1; *p != '\0'; p++)
	{
		if(*p == ' ' && *(p - 1) == ' ')
			continue;
		cout << *p;
	}
	cout << endl;
	return 0;
}
int main(){
     int len,i;
     char s[100];
     gets(s);
     len=strlen(s);
     if(s[0]!=' '){ printf("%c",s[0]); }
     for(i=1;i<len;i++){
          if(s[i]!=' '){ printf("%c",s[i]);  continue;}
          if(s[i-1]!=' '&&s[i]==' '){ printf("%c",s[i]); continue;}
          if(s[i-1]==' '&&s[i]==' '){continue;}
     }
     return 0;
}
//???????
//??
//???????????????????????????????????
//????
//??????????????????
//????
//???????
//????
//Hello      world.This is    c language.
//????
//Hello world.This is c language.
int main()
{
    int i,m=0;

	char c[1000],jg[1000];//??????
	cin.getline(c,1000);
    for(i=0;c[i]!='\0';i++)//???????
    {
    	if(c[i]!=' ')//???i?????
		{
			jg[m]=c[i];//????m?jg?
			m++;//m???????????????
		}
		else if(c[i]==' ' && c[i+1]!=' ')//??????
		{
			jg[m]=c[i];
			m++;
		}
	}
	jg[m]='\0';
	int t=strlen(jg);
	for(m=0;m<t;m++)
		{
			cout<<jg[m];
		}
    return 0;
}
int main()
{
	char str[100];
	cin.getline(str, 100);
	char * p = str;
	int i, j;
	int count = 0;
	for (i = 0; *(p + i) != '\0'; i ++)
	{
		
		if(*(p+i) == ' ')
			count ++;
		if (count == 1 && *(p+i) != ' ')
		 count = 0;
		if( count >= 2 && *(str+i) != ' ')
		{
			for (j = i - count + 1; *(p+j) != '\0'; j ++)
			 *(p+j) = *(p+j + count - 1);
			i -= count;
			count = 0;
		}
		
	}
	for (p = str; p < str +strlen(str); p ++)
	cout << *p;
	cout << endl;
	return 0;
}
int main()
{
	char a[200];
	int l,t=1;
	cin.getline(a,200);
	l=strlen(a);
	for(int i=0;i<l;i++)
	{
		if(*(a+i)!=' ')
		{
			t=0;
			cout<<*(a+i);
		}
		else if((*(a+i)=' ')&&t==0)
		{
			cout<<*(a+i);
			t=1;
		}
	}
    return 0;
}
void main ()
{ int a,n,i,k,leap=1;
  char s[200];
  gets(s);
  a=strlen(s);
  for(i=0;i<a;i++)
  { 
	  if(s[i]!=' ')
	  {leap=1;
		  printf("%c",s[i]);
	  }
	  if(s[i]==' '&&leap==1)
	  { printf(" ");
	   leap=0;
	  }
  }

}
int main()
{
   char a[100];
   gets(a);
   for(int i=0;a[i]!='\0';i++){
		   printf("%c",a[i]);
		   if(a[i]==' '){
	           for(int j=i+1;a[j]==' ';j++){
	                i++;	
			   }
		   }
   }
    return 0;
}
int main()
{
	char str[10000], count[10000], store[10000];;
	memset(count, 0, sizeof(count));
	int i = 0;
	while ((str[i] = cin.get()) != '\n')
	{
	   // ?????????????str[0]????
	   if ((str[i] != 32) || ((str[i] == 32) && (str[i - 1] != 32)))
	   {
		   store[i] = str[i];
		   count[i]++;
		   i++;
	   }
	   if ((str[i] == 32) && (str[i - 1] == 32))
	   {
		   count[i] = 2;
		   i++;
	   }
	} 
	i = 0;
	while (count[i] > 0)
	{
		if (count[i] == 1)
		{
			cout << str[i];
		}
        i++;
	}
	return 0;
}
int main()
{
	char a[200];
	cin.getline(a,199);
	int length=strlen(a),i=0;
	for(i=0;i<length;i++)
	{
		if(i>0)
		{
			if(a[i]==32&&a[i-1]==32)
				continue;
			else
				cout <<a[i];
		}
		else
			cout <<a[i];
	}
	cout <<endl;
	return 0;
}
int main(){
    char a[201], b[201];
    int m, n=0, len;
    gets(a);
    len=strlen(a);
    for(m=0;m<len;m++){
        if(a[m]==' '&&a[m+1]==' '){}else{
            b[n]=a[m];
            n++;
        }
    }
    b[n]='\0';
    printf("%s", b);
    return 0;
}
int main()
{
	char str[200];
	char *pointer=NULL;
	cin.getline(str,200);
	pointer=str;
	while(*pointer!='\0')
	{
		if(*pointer!=' ')
			{
				cout<<*pointer;
				pointer++;
		}
		else
		{
			while(*(pointer+1)==' ')
				
					pointer++;
			pointer++;
			cout<<' ';
		}
	}
	return 0;
}
int main(){
    int n,m,k,h,g,l,p;
    char zfc[200],zfc1[200],e,a;
    gets(zfc);
    m=strlen(zfc);
    p=0;
    zfc1[0]=zfc[0];
   for(k=1;k<n;k++){
       if(zfc[k]==' '&&zfc[k-1]!=' '){p++;
       zfc1[p]=zfc[k];
       }
       else if(zfc[k]!=' '){p++;
       zfc1[p]=zfc[k];
       }
   }
      printf("%s",zfc1);
   return 0;
}
int main()
{
	char a[200],b[200];
	gets(a);
	char *p,*q;
	p=a;
	q=b;
	*q=*p;
	q=b+1;
	for(p=a+1;*p!='\0';p++)
	{
		if(*(p)==' '&&*(p-1)==' ')
			continue;
		*q=*p;
		q++;
	}
	
	*q='\0';
	cout<<b;
		return 0;
}
//******************
//???????****
int main()
{
	char str[201];
	gets(str);
	int len;
	len=strlen(str);
	
	for(int i=0;i<len;i++)
	{
		if(str[i]!=' ')
			cout<<str[i];
		else
		{
			if((str[i]==' ')&&(str[i+1]!=' '))
				cout<<str[i];
			if((str[i]==' ')&&(str[i+1]==' '))
				continue;
		}
	}
	return 0;
}
int main()
{
     int i=0;
	 char c;

	 while((c=getchar())!='\n')
	 {
	 if(c!=' '){
		 cout<<c;
	     i=0;
		 continue;}

	 while(c==' ')
	 {
	     i=i+1;
		 if(i>=2)break;
		 cout<<c;
	 }
	 }
	 	 return 0;}
void main()
{
    int i;
    char *p;
    p=(char*)calloc(1000,sizeof(char));
    gets(p);
    for(i=0;*(p+i)!='\0';i++)
    {if(*(p+i)!=' ')
    printf("%c",*(p+i));
    else {
         if(*(p+i+1)!=' ')
         printf(" ");
         } 
         }                  
}