semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//???????????? 
//????????????????????????????????????????

int main()                        //?????
{
	char words[101];         //????????????????
	int i;                   //??????i
	cin.get(words,101);      //??????????????
	for(i=99;i>0;i--)        //???????????????
	{
		if(words[i]==32&&words[i-1]==32)    //?????????????????????????
		    words[i]=1;   //?????????1
	}
	for(i=0;i<strlen(words);i++)    //????????????
	{
		if(words[i]!=1)        //???????1
		    cout<<words[i];  //???????
	}
		return 0;
}                            //?????
/**
 * ? ? ?????????
 * ?    ?????
 * ????: 2010?12?09?
 * ???????????????????????????????????
*/
int main()
{
	int len, count = 0;			//????len?????????count?????????????????
	char *p, *q;				//??????
	char a[101];
	cin.getline(a,101);
	len = strlen(a);
	for ( q = a, p = a; p < a + len; p++ )
		if ( (*p != ' ') || (( *p ==' ') && ( *(p+1) != ' ')))		//?????????????????????????????
			{
				*(q++) = *p;							//??????????????
				count++;
			}
	for ( q = a; q < a + count; q++ )		//???????
	cout<<*q;
		return 0;
}
int main()
{
    int i,j,k;
    char c[120];
    gets(c);
    for(i=0;c[i]!='\0';i++)
    {
        if(c[i]==' '&&c[i+1]==' ')
        {
             for(j=(i+1);c[j]==' ';j++);
             for(k=1;c[j+k-1]!=' '&&c[j+k-1]!='\0';k++)
             {
                 c[i+k]=c[j+k-1];
                 c[j+k-1]=' ';
             }
             if(c[j+k-1]=='\0')
             c[i+k]=c[j+k-1];
        }
    }
    printf("%s",c);
    getchar();
}
int main()
{
	char str[200];
	int i;
	for(i=0;i<200;i++)
	{
		*(str+i)='a';
	}
	gets(str);
	for(i=0;i<strlen(str);i++)
	{
		if(*(str+i)!=' ')
		{
			cout<<*(str+i);
		}
		else
		{
			if(*(str+i+1)!=' ')
			{
				cout<<*(str+i);
			}
		}
	}
	cout<<endl;
	return 0;
}
int main()
{
	char a[100],b[100];
	gets(a);
	int i,j;
	i=0;
	j=0;
	while(a[i]!='\0')
	{
		if(a[i]==' ')
		{
			b[j]=' ';
			j++;
			do
			{
				i++;
			}
			while(a[i]==' ');
		}
		else
		{
			b[j]=a[i];
			i++;
			j++;
		}
	}
	b[j]='\0';
	printf("%s",b);
	return 0;
}
int main()
{
	char a[101],b[101];
	int i;
	cin.getline(a,101,'\n');
	int la,t=1,k=0;
	la=strlen(a);
	for(i=0;i<la;i++)
	{
		if(a[i]!=' ') 
		{
			t=0;
			b[k]=a[i];
			k++;
		}
		else 
		{
			if(t==0)
			{
				t=1;
				b[k]=a[i];
				k++;
			}
		}
	}
	b[k+1]='\0';
	for(i=0;i<=k-1;i++)
		cout<<b[i];
	cout<<endl;
	return 0;
}
int main ()
{
	char str[100] ;
	int i , j , flag = 0 ;
	cin.getline(str,100) ;
	for ( i = 0 ; ; i++ )
	{
		if ( *(str+i) == ' ' && flag == 1 )
		{
			for ( j = i ; ; j++ )
			{
				*(str+j) = *(str+j+1) ;
				if ( *(str+j) == '\0' ) break ;
			}
			i-- ;
		}
		if ( *(str+i) == ' ' ) flag = 1 ;
		else flag = 0 ;
		if ( *(str+i) == '\0' ) break ;
	}
	cout << str << endl ;
	return 0 ;
}
void main()
{
	char a[100];
	int l,i;
	gets(a);
	l=strlen(a);
	for(i=0;i<l;i++)
	{
		if(a[i]!=' '||(a[i]==' '&&a[i+1]!=' '))
			printf("%c",a[i]);
		if(a[i]==' '&&a[i+1]==' ')
			continue;
	}
	printf("\n");
}
int main(){
	char zfc[101],dy[101]={0};
	gets(zfc);
	int l=strlen(zfc);
	int j=0,k;
	for(int i=0;i<l;i++){
		if(zfc[i]!=' '){
			dy[j]=zfc[i];
			j++;
		}else if(zfc[i]==' '){
			if(zfc[i+1]!=' '){
				dy[j]=' ';
				j++;
			}
		}
	}
	for(k=0;k<j;k++){
		printf("%c",dy[k]);
	}



	return 0;
}
/*	???:???????
	???:1000012896 leo
	??:2010.12.13
	????:???????
	*/
int main()
{
	char str[101];
	int flag = 1;
	cin.getline (str, 100);
	char * p, * q;
	for (p = str + 1; p <= str + strlen(str) - 2;)
	{
		if (* p == ' ' && flag == 0)
		{
			for (q = p; q <= str + strlen(str) - 1; q++)
				* q = * (q + 1);
			continue;
		}
		if ( * p == ' ')
			flag = 0;
		else 
			flag = 1;
		p++;
	}
	cout << str;
	return 0;
}
main()
{
      char str[10000]; 
      gets(str);
      int lenth,count=0;
      lenth=strlen(str);
      for(int i=0;i<lenth;i++)
      {
                          if(str[i]==' ')
                          count++;
                          else count=0;
                          if(count<2)
                          printf("%c",str[i]);
      }
      getchar();
      getchar();
      return 0;
}
void main()
{
	char s[101],*p;
	gets(s);
	p=s;
	while(*p!='\0')
	{
		if(*p!=' ')
		{
			printf("%c",*p);
			p++;             //
		}
		if(*p==' ')
		{
			printf(" ");
			do{p++;}while(*p==' ');
		}
	}

}
//???2010?12?8?

//???1000010586_???

//??????????

int main()
{
	int i = 0 ;                         
	char word[ 100 ] , str[ 100 ];
	char *p , *q;
	cin.getline( word , 100 );
	p = word;
	for ( ; *p != '\0' ; p++ )
	{
		if ( *p == ' ' && *( p - 1 ) == ' ' )
			continue;
		str[ i ] = *p;
		i++;
	}
	str[ i ] = '\0';
	q = str;
	cout << q << endl;
	return 0;
}
int main()
{
  char a[101] ;
  cin.getline( a ,101 );
  char *p;
  p = a ;
  int i ;
  int len = strlen(a) ;
  for( i = 0 ; i <= len - 1 ;i ++ )
  {
    if( p[i] != ' ')
    cout << p[i] ;     
    else if ( (p[i -1] !=' ')&&( p[i] == ' '))
    cout <<" ";  
  }
  cout << endl ;
  return 0 ;
    
    
    
    
    
    
    
    
    
    
    
}
int main()
{
	int i,len,n=0;
	char s[NUM],c[NUM];
	gets(s);
	len=strlen(s);
	for(i=0;i<len-1;i++)
	{
		if(s[i]==' '&&s[i+1]==' ')
		{
			continue;
		}
		else
		{
			c[n]=s[i];
			n++;
		}
	}
	if(s[len-1]!=' ')
	{
		c[n]=s[len-1];
		c[n+1]='\0';
	}
	else
	{
		c[n]='\0';
	}
	printf("%s",c);
	return 0;
}
int main()
{
	int i,l,j;
    char x[101];
	cin.get(x,100);
	l=strlen(x);
	for(i=0;i<100;i++)
	{
		if(x[i]==32&&x[i+1]==32)
		{
			for(j=i;j<=100;j++)
			{
				x[j]=x[j+1];
			}
			i--;
		}
	}

    cout<<x;

    return 0;
}
int main ()
{
	char a[100];
	char *p;
	int i, j, k;
	cin.getline(a,100);
	p = a;
	for( i = 0;*(p+i) != '\0';i++)
	{
		if(*(p+i)==' ')
		{
			for(j = i+1; ;j++)
			{
				if(*(p+j)==' ')
				{
					j--;
					for(k=j;*(p+k)!='\0';k++)
						*(p+k) = *(p+k+1);
				}
				else break;
			}
			i = j;
		}
	}
		cout << p <<endl;
		return 0;
}
/*
 * 1.cpp
 *
 *  Created on: 2011-1-8
 *      Author: Administrator
 */
int main(){
	char string[101];
	cin.getline(string,101);
	int i,j,lenth = strlen(string);
	for(i=0;i<lenth;i++){
		if(string[i]=='\0')  break;
		if(string[i]==' '){
			j=i;
			while(true){
				if(string[j+1]!=' ')  break;
				j++;
			}
			int l=j-i;
			for(j=i+1;j<lenth-l;j++){
				string[j]=string[j+l];
			}
			string[j]='\0';
		}
	}
	cout<<string<<endl;
	return 0;
}
int main(){
  char sz[200];
  gets(sz);
  int k;
  for(int i=0;i<100;i++){
    for(k=0;sz[k]!='\0';k++){
	    if(sz[k]==' '){
		      if(sz[k+1]==' '){
			      for(;sz[k]!='\0';k++){
			        sz[k]=sz[k+1];
				  }
			  }
		}
	}
  }
  puts(sz);
  return 0;
}
int main ()
{
	int i = 0, j, l;
	char str[150] = {0};
	gets ( str );
	l = strlen( str );
	while ( str[i] != '\n' )
	{
		while ( str[i] != ' ' )
		{	
			if ( str[i] == '\0' )
			{
				cout << endl;
				return 0;
			}
			cout << str[i];
			i++ ;
		}
		cout << " " ;
		while ( str[i] == ' ' )
		{
			if ( str[i] == '\n' )
			{
				cout << endl;
				return 0;
			}
			i++;
		}
	}
	return 0;
}
//************************************************************************
//* ??? ????????.cpp                                          *
//* ?? ????                                                        *
//* ???? ?2010?11?26?                                            *
//************************************************************************
int main()
{
	char a[100];                                  //????????
	gets( a );                                    //??????
	char*p;
	p=a;                                          //??????p,?????????????
	int i;
	for ( i=0; a[i]!='\0' ; i++ )
	{
		if ( *(p+i)==' '&&*(p+i-1)==' ' )         //??i?????i+1???????,?????i???
			continue;
		cout<<*(p+i);
	}
	cout<<endl;
	return 0;
}
int main()
{
	char a[110]={0};
	int i,n;
	for(i=0;i<110;i++)
	{
		scanf("%c", &a[i]);
		if(a[i]==' ' && a[i-1]==' ') i-=1;
		if(a[i]=='\n')
		{
			n=i;
			break;
		}
	}
	for(i=0;i<n;i++)
	{
		printf("%c", a[i]);
	}
	printf("\n");
    return 0;
}
int main()
{
	char str[101]={'\0'};
	char a[101]={'\0'}; 
	int i,m=0,n=0;
	gets(str);
	for(i=0;str[i]!='\0';i++)
	{
		if(str[i]!=' ')
		{
			a[i-n]=str[i];
			m=0;
		}
		else if(str[i]==' ' && m==0)
		{
			a[i-n]=str[i];
			m=1;
		}
		else if(str[i]==' ' && m==1)
		n++;
	}
	puts(a);	return 0;
}
//???2010?12?8?

//???1000010586_???

//??????????

int main()
{
	int i = 0 , j , len;
	char word[ 100 ] , str[ 100 ];
	char *p , *q;
	cin.getline( word , 100 );
	p = word;
	for ( ; *p != '\0' ; p++ )
	{
		if ( *p == ' ' && *( p - 1 ) == ' ' )
			continue;
		str[ i ] = *p;
		i++;
	}
	str[ i ] = '\0';
	q = str;
	cout << q << endl;
	return 0;
}
int main()
{
	int m=0,i;
	char str[100];
	char *p=NULL;
	gets(str);
	p=str;
	for ( i=0;i<strlen(str);i++)
		{
			if ( *p == ' ' && m == 1 );
			else
				cout << *p;
			if ( *p == ' ' )
				m=1;
			else
				m=0;
			*p++;
		}
	return 0;
}
//
//  main.cpp
//  hw
//
//  Created by ? ? on 12-12-16.
//  Copyright (c) 2012? ? ?. All rights reserved.
//


int main(int argc, const char * argv[])
{
    char str[LEN];
    gets(str);
    int len=strlen(str),k;
    for (int i=0; i<len; i+=k) {
        k=1;
        if (str[i]!=' ') {
            cout<<str[i];
        }
        else
        {
            cout<<" ";
            while (str[i+k]==' ') {
                k++;
            }
        }
    }
   return 0;
}
int main(){
    int i;
	char str[101];
	gets(str);
	printf("%c",str[0]);
	for(i=1;i<strlen(str);i++){
		if(str[i]!=' '){
			printf("%c",str[i]);
		}else if(str[i-1]!=' '){
			printf(" ");
		}else{
			continue;
		}
	}
	printf("\n");
}
//??????
//???
//1000010098
int main ()
{
	char a[101];
	char *arr = a + 1, *j = NULL;
	cin.getline(a,101);
	for(; *arr != '\0'; arr++)
	{
		if(*arr == ' ')
		{
			j = ++arr;
			while(*j == ' ')
			j++;
			strcpy(arr,j);
		}
	}
	cout << a << endl;
	return 0;
}
int main()
{
	char a[100],b[100];
	cin.getline(a,100);
	int n;
	n = strlen(a);
	int flag = 0;
	int i,j=0;
	for(i=0;i<n;i++)
	{
		if(a[i]!=' ')
		{
                           flag =0;
			b[j] = a[i];
			j++;
		}
		if((a[i]==' ')&&(flag==0))
		{
			b[j] = a[i];
			j++;
			flag = 1;
		}
		else
			continue;
	}
	int m;
	m = j;
	for(j=0;j<m;j++)
		cout<<b[j];
	return 0;
}
int main()
{
	char c;
	c = getchar();
	while (c != '\n')
	{
		if (c == ' ')
		{
			cout << " ";
			while (c == ' ')
				c = getchar();
		}
		cout << c;
		c = getchar();
	}
	return 0;
}
void main ()
{
     char s[1000];
     int l,i,j,a[1000]={0};
     gets(s);
     l=strlen (s);
     for (i=0;i<l;i++)
     {
         if (s[i]==' ')
         {
               for (j=i+1;s[j]==' ';j++)
               {
                   a[j]=1;
               }
               i=j;      
         }
     }
     for (i=0;i<l;i++)
     {
         if (a[i]==0)
         printf("%c",s[i]);
     } 
     
}
int main(){
    int i,j,a;
    char x[200],y[200];
    gets(x);
    a=strlen(x);
    if(a!=1){
        y[0]=x[0];
        j=1;
        for(i=1;i<a-1;i++){
            while(1){
                if(x[i]!=' '||(x[i]==' '&&x[i-1]!=' ')){
                    y[j]=x[i];
                    j++;
                    break;}
                else{break;}}}
        y[j]=x[a-1];
        y[j+1]='\0';
    }
    if(a==1){
        y[0]=x[0];
        y[1]='\0';
    }
    puts(y);
    return 0;
}
int main(){
    char  cs[300],jg[200]={'\0'};
    gets(cs);
    int i,t=0,m;
    for(i=0;cs[i]!='\0';i++){
                             if(cs[i]!=' '){
                                         jg[t]=cs[i];
                                         t++;
                                         }
                             else{
                                  jg[t]=' ';
                                  t++;
                                  for(m=1;cs[i+m]==' ';m++);
                                  i+=m-1;
                                  }
                                  } 
    printf("%s",jg);
    
    return 0;
}
int main()
{
	char a[101];
	int num=0,i,j;
	for(i=0;i<101;i++)
	{
		scanf("%c",&a[i]);
		num++;
		if(a[i]=='\n')
			break;
	}
	for(i=0;i<num;i++)
	{
		if(a[i]==' ' && a[i+1]==' ')
		{
			for(j=i+1;j<num-1;j++)
				a[j]=a[j+1];
			num--;
			i--;
		}
	}
	for(i=0;i<num;i++)
		printf("%c",a[i]);
	return 0;
}
/*
 * qmcy0501.cpp
 *
 *  Created on: 2011-1-8
 *      Author: Administrator
 */
int main()
{
	char a[101];
	cin.getline(a,101);
	int i=0,j,m;
	while(true)
	{
		if(a[i]=='\0')
		{
			break;
		}
		else if(a[i]!=' ')
		{
			i++;
			continue;
		}
		else if(a[i]==' '&&a[i+1]!=' '&&a[i-1]!='\0')
		{
			i++;
			continue;
		}
		else
		{
			for(j=1;j<strlen(a);j++)
			{
				if(a[i+j]!=' ')
				{
					break;
				}
			}
			for(m=i+1;m<strlen(a)-j+2;m++)
			{
				a[m]=a[m+j-1];
			}
			i++;
		}
	}
	cout<<a<<endl;
	return 0;
}
//
//	?????	???????
//	?????	???????????????????????????????????
//	?????	?  ? ? ? ?? 1000012733 ?
//	?????	2010 ? 12 ? 10 ?
//
int main()
{
	char str[101];
	char *p;
	int i;
	cin.getline ( str, 101 );
	p = str;
	for ( i = 0; i < 101; i++ )
	{
		if (( *( p + i ) != '\0' ) && ( *( p + i ) != ' ' ))
			cout << *( p + i );
		if (( *( p + i ) == ' ' ) && ( *( p + i - 1 ) != ' ' ))
			cout << *( p + i );
		if ( *( p + i ) == '\0' )
			break;
	}
	return 0;
}
// shuchu.cpp : Defines the entry point for the console application.
//


int main()
{
	char str[101];

	cin.getline(str,101);
	
	int len = strlen(str);

	char*p = str;
	char*m;

	int i = 0;
	int t = 0;

	for(i = 0;i <= len;i++ )
	{
		if( *p == ' ' && *(p + 1) == ' ' )
		{
			m = p;

			for( t = i;t <len;t++ )
			{
				*p = *(p + 1);
				p++;
			}
			len--;
			i--;
			p = m;
			continue;
		}
		p++;
	}

	cout << str;

	return 0;
}
int main()
{
	char word[100];
	int i, len, flag = 0;
	cin.getline(word, 100);
	len = strlen(word);
	for (i = 0; i < len; i++)
	{
		if (word[i] != ' ')
		{	
			cout << word[i];
			flag = 1;
		}
		else if (flag == 1)
		{
			cout << " ";
			flag = 0;
		}
	}
	return 0;
}
int main(){    
char zfc[1000],cs[1000]; 
int n,e,j=0,i=0,a; 
gets(zfc);    
n=strlen(zfc); 
while(i<n){  
    e=0;  
    cs[j]=zfc[i];  
    if(zfc[i]==' '){   
        for(a=i+1;a<n;a++){    
            if(zfc[a]==' '){ e++; continue;  }    
            else{  break; }   
        }      
        i=i+e; }     
    j++;  i++; }
    cs[j]='\0';
printf("%s",cs);
return 0;
}
int main()
{
    char w[100]; 
    int sentencelength,i,c=0;
	gets(w);
    sentencelength=strlen(w);

    for (i=1;i<sentencelength;i++) 
	{
        if (w[c]== ' '&&w[i]==' ')
            continue;
        else 
		{
            c++;
            w[c]=w[i];
		}
	}
	w[++c]='\0';
    puts(w);
    return 0;
}
int main()
{
    char a[max];
    char b[max];
    int k[max]={0};
    int i,j;
    gets(a);
    for(i=1;a[i];i++)
    {
      if((a[i]==' ')&&(a[i-1]==' '))
      {
        k[i]=1;
      }
    }
    for(i=0,j=0;a[i];i++)
    {
     if(k[i]==0)
     {
     b[j]=a[i];
     j++;
     }
     else
     {    
         continue;
     }
    }
    b[j]='\0';
    puts(b);
    return 0;
}
int main(){
    char sz[100];
    int i,n,x;
   gets(sz);
n=strlen(sz);
for(i=0;i<n-1;i++){
    if(sz[i]==' '){
        if(sz[i+1]==' '){
            continue;
        }
        else{
            printf(" ");
        }
    }
    else{
        printf("%c",sz[i]);
    }
}
printf("%c",sz[n-1]);
return 0;
}
int main()
{
char a[1000];
int i,k,j=0,n,m=0;
gets(a);
while(1){
for(i=0;a[i]!='\0';i++){
if(a[i]==' '&&a[i+1]==' '){
for(k=i;a[k]!='\0';k++){
a[k]=a[k+1];
}
}
}
j=0;
for(m=0;a[m]!='\0';m++){
if(a[m]==' '){
if(a[m+1]==' '){
    j++;
}
}
}
if(j==0){
    break;
}
}
puts(a);
return 0;
}
//****************************************************************
// ????1000012789_1.cpp                                      *
// ???wusy                                                    *
// ???12,8                                                    *
// ???????                                                *
//****************************************************************
int main()
{
	char a[100];                                           // ??????                   
	cin.getline(a,100);                      
	int i, j, count = 0; 
	char *p = NULL;                                        // ????
	p = a; 
	for (i = 1; *(p + i - 1) != '\0'; i++)                     
	{
		if (*(p + i) == ' ')                                   // ?????????+1
			count++;
		else 
		{
			if (count >= 2)                                // ??????2
			{
				for (j = i; *(p + j - 1) != '\0'; j++)         // ????????????
					*(p + j - count + 1) = *(p + j);               // ????
				i = i - count + 1;                         // ?i?????
			} 
			count = 0;                                     // ?????
		} 

	}                                                // ????????
	for (p = a, i = 0; *(p + i) != '\0'; i++)                  // ??
		cout << *(p + i);
	return 0;
}
int main()
{
	char a[101],i;
	gets(a);
	for(i=0;i<strlen(a);i++)
	{
		if(a[i]!=' ')
		{
          printf("%c",a[i]);
		  continue;
		}
		else
		{
			printf(" ");
			while(a[i+1]==' ')
			 {
				 i=i+1;
			 }
		}
	}
	return 0;
}
int main()
{   char a[100];
	int b,i,j,d;
    char c[100]={0};
	 cin.getline( a,100);
      b=strlen(a);
	  cout<<a[0];
    for(i=1;i<b;i++)
    {
		 if(((a[i]==' ')&&(a[i-1]!=' '))||a[i]!= ' ')
		{   cout<<a[i];
			
		} 
	}
		
		return 0;
	}
int main()  										//???
{
	int i=0 , len;
	char str[100];
	char *p;
	gets(str);
	p = str;
	len = strlen(str);
		for(; ; p++)			//?????????????????????????????????????????????
		{
			if(*p != ' ')
				cout << *p;
			else
			{
				p++;
				if(*p != ' ')
					cout << ' ';
				p--;
			}
				i++;
				if(i>=len)
					break;
		}
	return 0;
}
void main()
{
	char s[100];
	int i,k;
	gets(s);
	for (i=1,k=1;s[i]!='\0';i++,k++)
	{
		if (s[i]==' '&&s[i-1]==' ')
		{
			k--;
		}
		else s[k]=s[i];
	}
	s[k]='\0';
	printf("%s\n",s);
}
int main()
{
	char a[100],b[100];                          //?????????????????????????????
	cin.getline(a,100);
	char *p=a,*q=b;                              //?????????????????????
	for(;*p!='\0';)                              //?a???????????
	{
		if(*p==' ')
		{
			p++;                                 //??????????????
			if(*p==' ')                          //????????????????
				continue;
			else                                 //???????????????????????????b??
			{
				p--;
				*q++=*p++;
			}
		} 
		else                                     //????????????????????b??
			*q++=*p++;

	}
	*q='\0';                                     //??b???
	cout<<b;
	return 0;
}
int main()                            //?????
{
	int i=0,j;                        //??????ij??????
	char str[100];                    //???????????????
	for(j=0;j<100;j++)                //??????????????0
	{str[j]=0;}
	cin.get(str,100,'\n');            //?????????????
	while(i<100)
	{  if(str[i]!=0)                  //??????????
	    {
			if(str[i]!=' ')           //?????????????????
	        {cout<<str[i];}
			if(str[i]==' '&&str[i+1]!=' ') //??????????????????????????
			{cout<<" ";}
	
	    }
	 i++; 
	}



return 0;

}
int main()
{
  char test[100];
  int len , i , j;
  cin.getline(test , 100);
  len = strlen(test);
  for (i = 0 ; i <= len - 1 ; i++)
  {
      if ((test[i] == ' ')&&(test[i - 1] == ' '))
      {
          for (j = i ; j <= len - 2 ; j++)
          {
              test[j] = test[j + 1];
          }
          len--;
          i--;
      }
  }
  for (i = 0 ; i <= len - 1 ; i++)
  {
      cout << test[i];
  }
  cout << endl;
  return 0;
}
int main()
{
	char a[100], b[100];
	cin.getline(a, 101);
	int i, j = 0;
	for (i = 0; a[i] != '\0'; i++)
	{
		if(a[i] != ' ')
			b[j] = a[i];
		if (a[i - 1] != ' ' && a[i] == ' ')
			b[j] = ' ';
		
		if (a[i - 1] == ' ' && a[i] == ' ')
			continue;
		j++;
		
	}
	b[j] = '\0';
	for (i = 0; b[i] != '\0'; i++)
		cout << b[i];


	return 0;
}
int main()
{
    int n=0,i,j,k,l;
	char str[101]={'\0'};
    gets(str);
	l=strlen(str);
	for(i=0;str[i]!='\0';i++){
		if(str[i]==' '){
			for(j=i+1;str[j]==' ';j++);
			l-=j-i-1;
			for(k=i+1;k<l;k++)
				str[k]=str[k+j-i-1];
			str[k]='\0';
		}
	}
	printf("%s",str);
	return 0;
}
int main()
{
	char a[100];
	gets(a);
	int len=strlen(a);
	int i,j;
	for(i=0;i<len;i++)
	{
		if(a[i]==' ')
		{
			for(j=1;j<(len-1-i);j++)
			{
				if(a[i+j]==' ')
					a[i+j]='#';
				else
					break;
			}
		}
	}
	for(i=0;i<len;i++)
	{
		if(a[i]!='#')
			printf("%c",a[i]);
	}
	return 0;

}
int main(int argc, char* argv[])
{
	char s[101],d[101];
	int i,k=0;
	gets(s);
	for(i=0;i<strlen(s);i++)
	{
		if((s[i]!=32)||(s[i+1]!=32))
		{    d[k++]=s[i];
		}
	}
		d[k]='\0';
		printf("%s",d);
	return 0;
}
/**
* @file 1000010424_4.cpp
* @author ???
* @date 2010?12?8
* @description
* ??????: ???????     
*/



int main()
{
	char input[101];							//??????
	char *place, *ptr;							//?????????

	cin.getline(input, 102);					//?????

	place = input;
	ptr = input;

	while(true)
	{
		while(*ptr != ' ' && *ptr != '\0')		//?????????????
			*place++ = *ptr++;					//?????????

		if(*ptr == '\0')						//????????
			break;

		*place++ = ' ';							//?????????

		while(*ptr == ' ')
			ptr++;								//???????????????????????
	}

	*place = '\0';								//?????

	cout << input << endl;

	return 0;
}
int main(){
	int a=0,i,n;
	char A[101];
	gets(A);
    for(i=0;A[i]!='\0';i++){
		if(A[i]!=' '){printf("%c",A[i]);}
		if(A[i]==' '){
		   printf(" ");
		   for(n=i;A[n]==' ';n++){
			   i=n;    } 
		}
		}
return 0;
}
int main(){
char sz[101];
int a,b;
gets(sz);
for(a=0;sz[a]!='\0';a++){
while(1){
if((sz[a]==' ')&&(sz[a+1]==' ')){
for(b=a+1;sz[b]!='\0';b++){
sz[b]=sz[b+1];
}
}else{
break;
}
}
}
puts(sz);
return 0;
}
//****************************************************** 
//* ? ? ?   ?? ? ? ? ? ? ?                  *
//* ? ?      ?? ? ?                              *
//* ? ? ? ??2010 ? 12 ? 8 ?                    * 
//* ? ?      ?1000010185                            *
//****************************************************** 
int main()
{
	char a[100];
	cin.getline(a, 100);
	char *p = a; // ??p?????a????
	for (; *p != '\0'; p++) // ??p???????a
		if (*p == ' ' && *(p + 1) == ' ') // ????????
		{
			for (char *q = p + 1; *q != '\0'; q++) // ????????????????????????
				*q = *(q + 1);
			p -= 1; // ???????????
		}
	cout << a;
	return 0;
}
//***************
//????2.cpp *
//?  ?????*
//***************
int main()
{
	char str[101];//?????
	int n=0,count=0,i,j,k;
	cin.get(str,101,'\n');//?get????????
	n=strlen(str);//?n????????
	for(i=0;i<n;i++)
	{
		if (str[i]!=' ')continue;
		for (j=i+1;j<n;j++)
		{
			if(str[j]==' ')
				count++;
			else
				break;
		}//????????????
		if(count>0)
		{
			for (k=i+1;k<n;k++)
				str[k]=str[k+count];
		}//?????????????????????
		count=0;
	}
	cout<<str;
	return 0;
}
int main()
{
	char str[300][100];
	int i, l, n;
	for (i = 0;;i++)
	{
		scanf("%s",str[i]);
		if (str[i][0] == '\0')
			break;
		l = strlen(str[i]);
		if (i == 0)
		{
			printf("%s",str[i]);
		}
		else printf(" %s",str[i]);
	}
	
	return 0;
}
int main()
{
    char str[101];
    cin.getline(str,100);
    for(int i=0;i<strlen(str)-1;i++)
    {
            if(str[i]!=' ')  cout<<str[i];
            else  if((str[i]==' ')&&(str[i+1]!=' '))
            {
                          cout<<str[i];
            }
            else  continue;
    }
    cout<<str[strlen(str)-1]<<endl;
    return 0;
}
//******************
//*????        *
//*1000010538      *
//******************
int main()
{
	char str[100];
	int i=0,j=0,k=0,m=0;
	cin.getline(str,101,'\n');             //??????????????
	k=strlen(str);                         //?????????
	for(i=0;i<k;i++)                        //??
	{
		if(str[i]==' ')                    //?????????
		{
			for(j=i;j<k;j++)               //????????????
			{
				if(str[j]!=' ')            //??????????????,??j-i????????
					break;
			}
		for(m=i+1;m<=j-1;m++)              //?????????????????????1
		{
			str[m]=1;
		}
		}
	}
	for(i=0;i<k;i++)                        //????1???
	{if(str[i]!=1)
	     cout<<str[i];
	}
		
	return 0; 
}                                             //?????
int main()
{
	char a[100]="";                      //???????
	int i;
	for (i=0;i<100;i++)
	{
		cin.get(a[i]);
		if (!(a[i-1]==32&&a[i]==32))
			cout<<a[i];                  //?????
	}
	return 0;
}