semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main (){
char t[150],x[150];
char *pt=t,*px=x;
gets(t);
for (;*pt!='\0';pt++,px++){
	if ((*pt!=' ')||((*pt=' ')&&(*(pt-1)!=' '))){
		
	*px=*pt;	
	}
	else {px--;}

}
*px='\0';
printf ("%s",x);
return 0;
}
int main()
{
	char a[100];//????????...
	cin.getline(a,101);
	int na,i,j;
	for(i=0;i<=100;i++)//??????????
	{
		if(a[i]=='\0')
		{
			na=i;
		}
	}
	for(i=0;i<=na;i++)//??????...
	{
		if(a[i]==' ' && a[i+1]==' ')
		{
			for(j=i;j<=na-1;j++)
			{
				a[j]=a[j+1];
			}
			na=na-1;
			i=i-1;

		}
	}

	cout << a;
	return 0;
}
int main()
{
    int i,m=0;
    char p[1000],q[1000];
    gets(p);
    for (i=0;p[i]!='\0';i++)
    {
        if (p[i]!=' ')
        {
            q[m]=p[i];
            m++;
        }
        else if (p[i]==' '&&p[i+1]!=' ')
        {
             q[m]=p[i];
             m++;
        }
        else
        {
            continue;
        }
    }
    for (int j=0;j<m;j++)
    {cout << q[j];}
    return 0;
}
int main()
{
    char word[100];
    int i=0,time=0;  //i??????time?????????? 
    
    cin.getline(word,100);  //?????
    
    for(i=0;i<100;i++) 
    {
      if (word[i]=='\0') break;    //???????????
      
      if(word[i]!=' ')   //?????????????????time??1 
        {
          cout<<word[i];
          time=1;
        }
      
      if (word[i]==' '&&time==1)  //??????????????????? 
        {
           cout<<" ";
           time++;       //?????+1 
        }
      
       
    }
    
return 0;
}
int main()
{
	char a[100],b[100];
	cin.getline(a,100);
	int i,k=0,n;
	n=strlen(a);
	for(i=0;i<=n;i++){
	  if((int)a[i]-32==0&&(int)a[i+1]-32==0)continue;
	  b[k]=a[i];
	  k++;
	}
	cout<<b<<endl;
	return 0;
}
int main()
{
	char str[100 + 10] = {'\0'};
	gets(str);
	int space = 1;
	for (int i = 0; str[i]; i ++)
	{
		if (str[i] == ' ' && space)
		    {space = 0; cout << str[i];}
		if (str[i] != ' ') 
		    {space = 1; cout << str[i];}
	}
	cout << endl;
	return 0;
}
void main()
{
	char a[100], i;
	gets(a);
	for(i=0; a[i]!='\0'; i++)
	{
		if(a[i]!=' ')
		{
			if(a[i-1]==' ')
				printf(" %c", a[i]);
			else
				printf("%c", a[i]);
		}
	}
	printf("\n");
}
int main(int argc, char *argv[])
{
  char str[101]={' '};
  int i;
  gets(str);
  for(i=0;i<strlen(str);i++)
{
                   if(str[i]==' '&&str[i+1]!=' ')
                   printf("%c",str[i]);
                   else if(str[i]!=' ')
                   printf("%c",str[i]);
}
                   
  
  return 0;
}
int main()
{
    char str[100];
    gets(str);
    int len = strlen(str);
    for(int i = 0 ; i < len ; i++)
    {
        if(str[i] == ' ')
        {
            cout << str[i];
            while(str[++i] == ' ');
        }
        cout << str[i];
    }
    return 0;
}
int main(){
	int i,j;
	char s[101],a[101];
	gets(s);
	for(i=0,j=0;s[i]!='\0';i++){
		if(s[i]==' ')
		continue;
		else{
			a[j++]=s[i];
			if(s[i+1]==' ')
			a[j++]=' ';
			}
		}
	a[j]='\0';
	puts(a);
	return 0;
}
int main(){
	char a[MAX],b[MAX];
	int i,len,j;
	gets(a);
    len=strlen(a);
	for(i=0,j=0;i<len;i++){
		if(a[i]=='\0'){
			break;
		}
		if(a[i]==' '&&a[i+1]==' '){
			continue;
		}
		b[j]=a[i];
		j++;
	}
	b[j]='\0';
	puts(b);
	return 0;
}
int main(){
    int i,j=0,a=0;
    char s[101];
    char z[102];
    gets(s);
    for(i=0;i<100;i++){
        z[i]=' ';
    }
    for(i=0;!(s[i]==0);i++){
        if(!(s[i]==' ')){
           j=j+a;  
           z[j]=s[i];
           j++;
           a=0;
        }
        else{
            a=1; 
        }  
    }
    z[j]='\0';
    puts(z);
    return 0;
}
/*
?? 
???????????????????????????????????
 
???? 
??????????????????????????100?
 
???? 
???????
 
???? 
Hello      world.This is    c language.
 
???? 
Hello world.This is c language.
 
?? 
gets(char [] str)?????????????str 


*/



int main()
{
	char b;
	int i;
	while(1)
	{
		b=getchar();
		if (b=='\n')
		{
			break;
		}
		else if (b==' ')
		{
			cout<<' ';
			while(1)
			{
			    b=getchar();
				if (b!=' ')
				{
					cout<<b;
					break;
				}
			}
		}
		else 
		{
			cout<<b;
		}
	}
	cout<<endl;
	return 0;
}
int main()
{
   int i,j;
   char s[101];
   gets(s);

   for(i=0;s[i]!='\0';i++)
     if((s[i]==' ')&&(s[i+1]==' ')) 
        { {for(j=i;s[j]!='\0';j++)
             s[j]=s[j+1];}
         i--;}
  
  puts(s);
  return 0; 
}
int main()
{
	char str[101];

	cin.getline(str, 101);
	for (int i = 0; ; i++)
	{
		if (str[i] == ' ')
			if (str[i + 1] == ' ')
				str[i] = '0';
		if (str[i] == '\0') break;
	}
	for (int i = 0; ; i++)
	{
		if (str[i] == '\0') break;
		if (str[i] != '0')
			cout << str[i];
	}
	return 0;
}
void main(){
	char c;
	int flag=0;
	do{
		scanf("%c",&c);
		if(c==' '){
			if(flag==0){
				flag=1;
				printf("%c",c);
			}
			else
				flag=1;
		}
		else
			flag=0;
		if(flag==0)
			printf("%c",c);
	}while(c!='\n');
}
//???????
//??????
//?????????????????
int main()
{
	char sen[101];						//????
	int len;							//??????
	cin.getline(sen,101,'\n');			//????
	len=strlen(sen);					//????
	for(int i=0;i<len;i++)				//i?????
		if(sen[i]==' ')					//?sen[i]???
		{
			int j=i+1;					//j?????
			while(sen[j]==' ')			//?j??????j+1??????????
				j++;
			for(int k=j;k<101;k++)		//???????????????
				sen[k-j+i+1]=sen[k];
		}
	cout<<sen;							//??
	return 0;
}
int main()
{
	char str[100];
	cin.getline(str, 100);
	int i, j;int count = 0;
	for (i = 0; str[i] != '\0'; i ++)
	{
		
		if(str[i] == ' ')
			count ++;
		if (count == 1 && str[i] != ' ')
		 count = 0;
		if( count >= 2 && str[i] != ' ')
		{
			for (j = i - count + 1; str[j] != '\0'; j ++)
			 str[j]=str[j + count - 1];
			i -= count;
			count = 0;
		}
		
	}
	cout << str << endl;
	return 0;
}
//***************************************************
//*                           ???????        *
//*                       2010.11.19                *
//***************************************************
int main()
{
	char a[100];                      //????a?
	int i,j,k,n;
	cin.get(a,100,'\n');              //???????
	n=strlen(a);                      //n???????
	for(i=0;i<n;i++)    
	{
		if(a[i]==' ')            //??????
		{
			for(j=1;;j++)   //????????????????????????????????
			 if(a[j+i]!=' ') break;
			for(k=i;k<n;k++)  //??????????????????????
				a[k+1]=a[k+j];
		}
		
		
	}
	cout<<a;                                     //?????
			 



	return 0;
}
//****************************************************************************************
//*  ?????????? 																 *
//*  ??????????????????????????????????????        * 
//*  ???????					   													 *
//*  ???2010?12?8?															     *
//****************************************************************************************
int main()
{
	char str[101];										//?????
	int i, j, num, a;									//????
	cin.getline (str, 101);								//?????
	num = strlen(str);									//????????
	for (i = 0; i < num; i++)							//????
	{
		a = 0;
		if ( *(str + i) == ' ')							//?????
		{
			for (j = i; j < num; j++)					//???????????
			{
				if (*(str + j) != ' ')
					break;
				a++;
			}
			for (j = i + 1; j < num; j++)				//?????????????
				*(str + j) = *(str + j + a - 1);
		}
	}
	cout << str << endl;								//???????????
	return 0;
}
int main()
{
	int i,j,n,k=0;
	int e;
	char a[101];
	char b[101];
	gets(a);
	b[0]=a[0];
	for(n=0;a[n]!='\0';n++);
	for(i=1;i<n+1;i++){
		if(a[i]!=' '&&a[i]!='\0'){
			k++;
			b[k]=a[i];
		}
		if((a[i]==' '&&a[i+1]!=' '&&a[i-1]!=' ')||(a[i]==' '&&a[i+1]==' '&&a[i-1]!=' ')){
			k++;
			b[k]=a[i];
		}
		if(a[i]=='\0'){
			k++;
			b[k]=a[i];
		}
	}
	printf("%s",b);
	return 0;
}
int main()
{
	char a[101];
	int n,i;
	gets(a);
	n=strlen(a);
	for(i=0;i<n;i++)
	{
		if(a[i]!=' ')
			printf("%c",a[i]);
		else
		{
			do
			{
				i+=1;
			}
			while(a[i]==' ');
			i=i-1;
			printf(" ");
		}
	}
return 0;
}
/**
 *???1.cpp
 *??????
 *??????????
 *???12?10?
 */
int main()
{
	char a[101];
	gets(a);     //?????
	char*q=a;     //???????????
	for(q=a+2;*q!='\0';q++) //??????????
	{
		if(*q==' ' && *(q-1)==' ')//???2????
		{
			char*qq=q; //???2??????
			while(*(q+1)!='\0')
			{
				*(q++)=*(q+1);  //????????????
			}
			*q='\0';   //????????????
			q=qq-1;   //????????????????
		}
	}
	q=a;          //???????????????
	cout<<q<<endl;
	return 0;
}
int main()//????????????????
{
    char a[1000];//??????? 
    gets(a);//?? 
    int i=0,j,n;//n??? 
    n=strlen(a);
    for(i=0;i<n;i++)
    {
                   while(a[i]==' '&&a[i-1]==' ')//???????????? 
                   {
                              for(j=i+1;j<n;j++)//???? 
                                 a[j-1]=a[j];
                              a[n-1]='\0';
    }                          }
    cout<<a;//?????????                       
    getchar();
    getchar();                  
    return 0;
}
int main()
{
	char a1[101]={-1};//????
	int i;
	cin.getline(a1,101);//?????
	for(i=0;i<=100;i++)
	{
		  if(a1[i]==0)//??????????
		break;
		if(a1[i]!=32)//?????????????
			cout<<a1[i];
		else
			if(a1[i-1]!=32)//?????????????????
				cout<<a1[i];
      

	}
	return 0;
}
int main(){
    int i,j,k=0,p;
char zf[101],jg[101];
gets(zf);
for(i=0;zf[i]!='\0';i++){
    if(zf[i]==' '){
    jg[k]=' ';
    k++;
    j=i+1;
    while(zf[j]==' '){j++;}
    i=j;}
    jg[k]=zf[i];
    k++;    
}jg[k]='\0';
printf("%s",jg);
return 0;}
int main()
{
	char str[100];                          //????????????????
	int i,j;                      //????i?j???????
	cin.get(str,100);
	for(i=0;i<100;i++)
	{
		if(str[i]==32&&str[i+1]==32)
		{
			for(j=i+1;j<100;j++)
			{
				str[j]=str[j+1];
			}                           //???????????????????2???????????????
			i=i-1;
		}
	}
	cout<<str;
	return 0;
}
void main()
{
	char a[101];
	char *p=a;
	gets(a);
	for(p=a;*p!='\0';p++)
	{
		if(*p==' ')
		{
			if(*(p+1)==' ')continue;
			else printf("%c",*p);
		}
		else printf("%c",*p);
	}	
}
main()
{
      char a[101];
      int i,k=0;
      gets(a);
      for(i=0;i<101;i++)
      {
                        if(a[i]==' '&&a[i+1]==' ')
                        a[i]='0';
      }
      for(i=0;i<101;i++)
      {
                        if(a[i]!='0'&&a[i]!=0)
                        printf("%c",a[i]);
                        else if(a[i]==0)
                        break;
      }
      getchar();
      getchar();
}
int main(){
    int i,n,j,q=0;
    char a[101];
    gets(a);
    n=strlen(a);
    for(i=0;i<n-1;i++){
        if(a[i]==' '&&a[i+1]==' '){
            while(a[i+1]==' '){
           for(j=i;j<n-1;j++){
           a[j]=a[j+1];
           }
           q++;
            }
        }
    }
    a[n-q]='\0';
    printf("%s",a);
    return 0;
}
int main()
{
	int count = 0, m;
	char sentence[101] = {0};
	char *p;
	cin.getline(sentence,100);
	p = sentence;
	m = strlen(sentence);
	while(p - sentence < m)
	{
		if(*p != ' ')
		{
			count = 0;
		}
		if(*p == ' ')
		{
			count ++;
		}
		if(count <= 1)
		{
			cout << *p;
		}
		p++;
	}
	return 0;
}
int main()
{
	int c;
	char getline[MAX];
	int i=0;
	int ex=IN;
	int line=0;
	while ((c=getchar())!='\n')
	{
		if (c!=' ')
		{
			ex=IN;
			getline[i]=c;
			++i;
		}
		else if ((c==' ')&&(ex==IN))
		{
			getline[i]=c;
			++i;
			ex=OUT;
		}
		else if ((c==' ')&&(ex==OUT))
			ex=OUT;
	}
	line=i;
	i=0;

	for (i=0;i<line;++i)
		putchar(getline[i]);

}
int main()
{
    char a[101],b[101];
    int len1,len2,i,j=1;
    gets(a);
    len1=strlen(a);
    b[0]=a[0];
    for(i=1;i<len1;i++)
    {
      if(a[i]!=' ')
      {
         b[j]=a[i];
         j++;  
      }
      else if(a[i]==' '&&a[i+1]!=' ')
      {
         b[j]=a[i];
         b[j+1]=a[i+1];
         ++i;
         j+=2;
      }  
    }
    b[j]='\0';
    len2=strlen(b);
    for(i=0;i<len2;i++)
    {printf("%c",b[i]);}
                             
                
}
/*???:???????
**???:??
**?  ?:2010?12?10?
*/
int main()
{
	char sentence[101], *p1, *p2, *k;
	int l;//??????????
	cin.getline(sentence, 101);
	for (p1 = sentence; *p1 != '\0'; p1++)
	{
		if (*p1 == ' ')//????
		{
			k = p1 + 1;//????????
			for (p2 = k; *p2 != '\0'; p2++)//??????????
			{
				if (*p2 != ' ')//???????
				{
					l = strlen(sentence) - (p2 - sentence) + 1;//????????????(sentence?????)
					memcpy(k, p2, l);//?????,????
					break;//?????????
				}
			}
		}
	}
	cout << sentence << endl;//??
	return 0;
}
int main()
{
	char str[100],m[100];
	int count=0;
	char *p,*q=m;
	gets(str);
	for(p=str;*p!='\0';p++)
	{
		if(*p!=' ')
		{
			*q=*p;
			q++;
			count=0;
		}
		if(*p==' ')
		{
			count++;
		}
		if(count==1)
		{
			*q=' ';
			q++;
		}
	}
	*q='\0';
	cout<<m<<endl;
	return 0;
}
int main()
{

	char Sentence[100]={0};    //?????????????????
        int i=0;                  //?????i
        gets (Sentence);          //????
              for (i=0;i<100;i++)
                {  if(Sentence[i]==' ')               //???????''????????''??????????????
                       {  if(Sentence[i+1]!=' ')
	                    {cout<<' ';}
                        }
			 if (Sentence[i]==0)            //?????????????????
		             {break;}
     	                 if (Sentence[i]!=' ')         //???????????????''????
		            {cout<<Sentence[i];}
	 
                }
cout<<endl;
return 0;
}
/* ???
 * ?????
 */

int main(){
    char a[101];
    cin.getline(a,101);
    int l=strlen(a);
    int i,k;
    for(i=0;i<l;i++){
    if(a[i]==' '){
        if(a[i+1]==' '){
        for(int k=i;k<l-1;k++)
       {a[k]=a[k+1];}
            l--;i--;a[l]='\0';}
    }
    }
    cout<<a;
  return 0;}
int main(){
	int i,n;
	char A[101];
	gets(A);
    for(i=0;A[i]!='\0';i++){
		if(A[i]!=' '){printf("%c",A[i]);}
		if(A[i]==' '){
		   for(n=i;A[n]==' ';n++){
			   i=n;    } 
			   printf(" "); 
		}
		} 
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;

	for (i = 1; a[i - 1] != '\0'; i++)
	{
		if (a[i] == ' ')
			count++;
		else 
		{
			if (count >= 2)
			{
				for (j = i; a[j - 1] != '\0'; j++)
					a[j - count + 1] = a[j];
				i = i - count + 1;
			}
			count = 0;
		}

	}
	p = a;
	for (p = a, i = 0; a[i] != '\0'; i++)
		cout << p[i];
	return 0;
}
int main()
{
	char *p,a[100],flag=0;
	cin.getline(a,100,'\n');
	p=a;
	int l;
	l=strlen(a);
	for(p=a;p<a+l;p++)
	{
		if(*p==' '&&flag==0)
		{
			cout<<*p;
		}
		if(*p!=' ')
		{
			cout<<*p;
			flag=0;
		}
		else
		{
			flag++;
		}
	}
	cout<<endl;
	return 0;
}
int main()
{
	char s[101],a[101][101];
	int i,l,j=0,k=0;

	gets(s);

	l=strlen(s);

	for(i=0;i<l;i++)
		if(s[i]==' ')
		{	a[k][j]=0;
		    k++;
			j=0;
		}
		else
			a[k][j++]=s[i];


	a[k][j]=0;


	for(i=0;i<k;i++)
	  if(strlen(a[i]))
		printf("%s ",a[i]);
	printf("%s",a[k]);
	return 0;
}
int main(){
	char str[101];
	int i,p,n=0,j,end=0,duoyu=0;
	gets(str);
	p=strlen(str)+1;
	for(i=0;i<p;i++){
		if(str[i]==' '&&str[i+1]==' '){
			end++;
		}
	}
	for(i=0;i<p;i++){
		if(str[i]==' '&&str[i+1]==' '){
			duoyu++;
		}
		else if(str[i+1]!=' '){
			for(j=i;j<p;j++){
				str[j+1-duoyu]=str[j+1];
			}
			//printf("%s\n",str);
			//printf("%d\n",duoyu);
			i=i-duoyu;
			duoyu=0;
		}
	}
	//str[p-end]='\0';
	printf("%s",str);
	return 0;
}
int main()
{
    char str[100],str2[100];
    int i,j,l,sum;
    gets(str);
    l=strlen(str);
    j=0;
    sum=0;
    for(i=0;i<l;i++)
    {
            if(i==0&&str[i]==' ')
            continue;
            if(str[i]==' ')
            {
                         if(str[i+1]==' '||str[i+1]=='\0')
                         continue;
                         else
                         {
                             str2[j]=str[i];
                             j++;
                         }
            }
            else
            {
                str2[j]=str[i];
                j++; 
            }
           
     }     
     str2[j]='\0';
     puts(str2);
     getchar();
     getchar();
}
int main()
{
    char a[1000];
    gets(a);
    int k=0;
    int i,l;
    l=strlen(a);
    for(i=0;i<l;i++)
    {
                    if (a[i]!=' ')
                    {k=0;
                    printf("%c",a[i]);}
                    else 
                    {
                         k++;
                         if (k==1)
                         printf("%c",a[i]);
                    }
    }
    getchar();
}
int main(){
	char zx[100];
	
	int len;
	gets(zx);
	len=strlen(zx);
	char sj[100];
	int i=0;
	int j=0;
	while(i<len){
		if(zx[i]!=' '){
			sj[j]=zx[i];
			j++;
			i++;
		}else if(zx[i]==' '&&zx[i+1]!=' '){
			sj[j]=zx[i];
			i++;
			j++;
		}else if(zx[i]==' '&&zx[i+1]==' '){
			i++;
		}
	}
	sj[j]='\0';
	puts(sj);
	return 0;
}
int main()
{
	int i,m;
	char str[101];
	cin.getline(str,101,'\n');
	m=strlen(str);
	for(i=0;i<m;i++)
		if(str[i]!=32||(str[i]==32&&str[i+1]!=32))
			cout<<str[i];
	return 0;
}
int main(){
    char s[101];
    char *p,*q;
    int i;
    gets(s);
    p=s;
    while(*p!='\0'){
        if(*p==' '){
            q=p+1;
            if(*q==' '){
                *p='!';
            }
        }
        p++;
    }
   
    i=0;
    while(s[i]!='\0'){
        if(s[i]!='!') printf("%c",s[i]);
        i++;
    }

    return 0;
}
int main(){
	char a[101];
	cin.getline(a,101);
	for(int i=0;i<strlen(a);i++){
		if(a[i]==' '&&a[i+1]==' '){
			for(int j=i+1;j<strlen(a);j++){
				if(a[j]==' '){
					int k;
					for(k=j;k<strlen(a)-1;k++){
						a[k]=a[k+1];
					}
					a[k]='\0';
				}
				if(a[j]!=' '){i--; break;}
			}
		}
	}
	cout<<a<<endl;
	return 0;
}
int main()
{
    char string[100];
    gets(string);
    int i,j;
    int num;
    int count=0;
    num=strlen(string);
    for(i=1;i<num;i++)
    {
                    if(string[i]==' '&&string[i-1]==' ')
                    {
                                    for(j=i;j<num;j++)
                                    {
                                    string[j]=string[j+1];
                                    }
                                    count++;
                                    string[num-count]='\0';
                                    i=i-1;
                    }
                    
    }
    puts(string);                
    return 0;
    }
//***************************************************************************************
//*? ? ?:???????.cpp                                                          *
//*?    ?:??? 1000012817                                                           *   
//*????:2010-11-18                                                                  *                                 
//*????:???????????                                                      *
//***************************************************************************************
int main()						   //???
{
	int i,j;
	char a[101];					   //??????????
	cin.getline(a,101);				   //?????
	for (i=0;i<(strlen(a));){			   //???????
		if(a[i]==' '&&a[i+1]==' '){		   //?????????
			i=i;//????i??
			for(j=i;j<(strlen(a)+1);j++){	   //????????????
				a[j]=a[j+1];
			}
		}
		else i++;			 	   //????i=i+1
	}
	cout<<a;					   //????
	cout<<endl;
return 0;
}							   //?????
/*
 * 1000012826_???????.cpp
 *
 *  Created on: 2010-1-8
 *      Author: Administrator
 */

int main(){
int   i=0,j=0;
char   c;
char   s[100];
for   (;(c=getchar())!=EOF&&c!='\n';){
          if(c==' '&&j==0)   {
                  s[i++]=' ';
                  j=1;
                  }
          else   if(c==' ')   continue;
          else   {
                  s[i++]=c;
  j=0;
  }
        }
s[i]='\n';
for(i=0;s[i]!='\n';i++)
        putchar(s[i]);
        cout<<'\n';
}
int main()
{
	char str[100], t;
	int i, count = 0;
	gets(str);
	for (i = 0; str[i] != '\0'; i++)
	{
		if (str[i] != ' ' || str[i - 1] != ' ')
		{
			count++;
		}
	}
	for (i = 0; i < count; i++)
	{
		if (str[i] == ' ' && str[i + 1] == ' ')
		{
			for (int j = i + 1; str[j + 1] != '\0'; j++)
			{
				t = str[j];
				str[j] = str[j + 1];
				str[j + 1] = t;
			}
			if (str[i + 1] == ' ')
			{
				i--;
			}
		}
	}
	for (i = 0; i < count; i++)
	{
		cout << str[i];
	}
	cout << endl;
	return 0;
}
int main()
{ 
    char str[200];
     int i,n;
    gets(str);
   
    n=strlen(str);
     for(i=0;i<n;i++)
      {
                    if((str[i])!=' ')
                    {
                                printf("%c",str[i]);
                                }
                    else if((str[i])==' ')
                    {
                         if((str[i+1])==' ')
                         continue;
                         else if((str[i+1])!=' ')
                         {
                              printf("%c",str[i]);
                              }
                         }
                    
                    }
    
 
   return 0;
   }
int main()
{
	int i = 0;
	char a[102];
	gets (a);
	while (a[i] != '\0')
	{
		if (a[i] == ' ')
		{
			if (a[i-1] != ' ')
				cout << a[i];
		}
		else
			cout << a[i];
		i++;
	}
	return 0;
}
int main()
{
	int i,l,j;                               //????i,l,j
    char x[101];                             //??????x
	cin.get(x,100);
	for(i=0;i<100;i++)                       //????????????
	{
		if(x[i]==32&&x[i+1]==32)             //????????????????????i????
		{
			for(j=i;j<=100;j++)
			{
				x[j]=x[j+1];
			}
			i--;
		}
	}

    cout<<x;                                 //????

    return 0;
}
int main(){
	int i,l,k=0,c[100]={0};
	char a[100],b[100][100];
	gets(a);
	l=strlen(a);
	for(i=0;i<l-1;i++){
		if(a[i]!=' '){
			if(a[i+1]!=' '){
     			b[k][c[k]]=a[i];
				c[k]++;
			}
			else{
				b[k][c[k]]=a[i];
				b[k][c[k]+1]=' ';
				b[k][c[k]+2]='\0';
				k++;
			}
		}
	}
	b[k][c[k]]=a[l-1];
	b[k][c[k]+1]='\0';
	k++;
	for(i=0;i<k;i++)
		printf("%s",b[i]);
	return 0;
}
//*****************************
//* ???????????    *
//* ??????              *
//* ???2010-12-8           *
//* ??????????      *
//*****************************
int main()
{
	char s[100],*p = s;
	int i = 0;
	gets(s);
	while(p - s + 1 <= strlen(s))
	{
		if(*p != ' ')
			i = 0;
		if(*p == ' ')
			i++;
		if(i <= 1)
			cout << *p;
		p++;
	}
	return 0;
}
int main (){


	char a[101];
	cin.getline(a,101);
	int i,j;
	for(i=0;i<100;i++)

		if(a[i]==' ')
		{

			for(j=0;;j++)
				if(a[j+i+1]!=' ')
					break;
			for(int k=i+1;k<100;k++)
				a[k]=a[k+j];




		}


	cout<<a<<endl;








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