semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()

{
	int i, n, x, temp=0;
	int a[90];
	memset(a, -1, sizeof(a));
	a[89] = 2;
	cin >> n;
	if(n == 0)
		cout << "1";
	else
	{
		while(--n)
		{
			temp = 0;
			for(i = 89; a[i] != -1; i--)
			{
    			x = a[i] * 2 + temp;
				if(x < 10)
				{
		    		a[i] = x;
				    temp = 0;
			    }
				else
				{
					a[i] = x % 10;
					temp = x / 10;
					if(a[i - 1] == -1)
			    	{
				    	a[i-1] += temp + 1;
				    	break;
				    }
				}
			}
		}
		for(i = 0; i < 90; i++)
		{
			if(a[i] != -1)
		        cout << a[i];
		}
	}

	return 0;
}
int main()
{
	int a[100]={0},t=0,i,j,n;
	scanf("%d",&n);
	a[1]=1;
	for (i=1;i<=n;i++)
	{
		for (j=90;j>=1;j--)
		{
			a[j]*=2;
			a[j+1]+=a[j]/10;
			a[j]=a[j]%10;
		}
	} 
	n=99;
	while (n)
	{
		if (a[n]) t=1;
		if (t) printf("%d",a[n]);
		n--;
	}
}
int main()
{
   int a[1001];
   memset(a,0,sizeof(a));
   int i,j,k,n;
   int p = 0;
   cin >> n ;
   a[1] = 2 ;
   if(n == 0)
   {
     cout << "1";
   }
   else
   {
   for(i = 1; i< n; i++)
   {   
       p = 0;
     for(j = 1; j <=1000; j ++)   
     {
         a[j] = a[j] * 2 + p ;
         p = a[j] / 10;
         a[j] = a[j] % 10;
     }     
   }
   for( i = 1000; a[i] == 0 ; i-- );
       k = i ;
   for(i = k ;i >= 1 ; i -- )
   {
       cout<<a[i];
   }
   }   
     return 0 ;
}
int main()
{
    void fun ( int[] );
    int num[1000], i, n;
    cin >> n;
    memset( num, 0, sizeof(num) );
    num[0] = 1;
    for ( i = 1; i <= n; i++ )
        fun ( num );
    int *p = NULL;
    for ( p = num + 999; *p == 0; p-- );
    for ( ; p >= num; p-- )
        cout << *p;
    return 0;
}
void fun ( int num[] )
{
     int *p = NULL;
     for ( p = num; p < num + 1000; p++ )
         *p = 2 * *p;
     for ( p = num; p < num + 1000; p++ )
         if ( *p > 9 )
         {
              *p = *p - 10;
              *( p + 1 ) = *( p + 1 ) + 1;
         }
}
int main(int argc, char* argv[])
{
	int n;
	double s=2;
	scanf("%d",&n);
	int i;
	if(n==0){
		s=1;
	}
	if(n==1){
		s=2;
	}
	if(n>=2){	
	  for(i=2;i<=n;i++){
		  s=s*2;
	  }
	}
	printf("%.0lf",s);
	return 0;
}
int main(){
    char ANS[MAX];
    memset(ANS,0,sizeof(ANS));
    ANS[0]='1';
    ANS[1]='\0';
    int N;
    cin>>N;

    for(int i=1;i<=N;i++){
        int LEN=strlen(ANS);
        int g=0,h=0,k;

        for(k=0;g||k<LEN;k++){
            int mk=0;
            if(k<LEN) mk=ANS[k]-'0';
            h=mk*2+g;
            g=h/10;
            ANS[k]=h%10+'0';
        }

        ANS[k]='\0';
    }
    for(int i=0;i<strlen(ANS);i++) cout<<ANS[strlen(ANS)-i-1];

    return 0;
}
int main()
{	
	int i, n, a[102]={0}, b[102]={1}, j; //a????????b????????n????
	cin >> n;  //??n
	if (n==0)  //??n?0
		cout << "1" << endl;  //??1
	else  //??n????
	{
		for (j=1;j<=n;j++)  //???n?
		{
			for (i=0;i<101;i++)  //?????????
			{
				a[i] = 2 * b[i];
			}
			for (i = 0; i < 101; i++)  //????????????10???1
			{
				if (a[i]>=10)
				{
					a[i+1] += a[i]/10;
					a[i] %= 10;
				}
			}
			while (a[i]==0)  //???????0??
				i--;
			for (; i>=0; i--)  //???????????????b
			{
				b[i] = a[i];
				if (j == n)  //?????n?
					cout << a[i];  //????
			}
		}
		cout << endl;
	}
	return 0;
}
void cf(char a[])
{
	int t=strlen(a),i;
	for(i=0;i<t;i++)
		a[i]=(a[i]-48)*2+48;
	for(i=0;i<t-1;i++)
	{
		if(a[i]>57)
		{
			a[i]-=10;
			a[i+1]+=1;
		}
	}
	if(a[t-1]>57)
	{
		a[t-1]-=10;
		a[t]='1';
	}
}
void strre(char a[])
{
	int i,j,k;
	char t;
	k=strlen(a);
	for(j=0,i=k-1;j<k/2;j++,i--)
	{
		t=a[j];
		a[j]=a[i];
		a[i]=t;
	}
}
void main()
{
	int n;
	char a[100]={'1'};
	scanf("%d",&n);
	while(n--)
	{
		cf(a);
	}
	strre(a);
	puts(a);
}
//********************************
//*?????2?N??   **
//*?????? 1300012861 **
//*???2013.11.17  **
//********************************
int main()
{
	int N, i, j, len,t;
	const int MAX_LEN = 200;
	unsigned num[MAX_LEN]; 
	memset(num, 0, sizeof(num)); //????
	num[0] = 2; 
	len = 1; 
	cin >> N; 
	if ( N == 0 )
		cout << 1 << endl; 
	else
	{
		for ( i = 2; i <= N; i++ )
		{
			t=0;
			for ( j = 0; j < len; j++ )
			{	num[j] = 2 * num[j]+t;
				t=num[j]/10;
				num[j]%=10;
			}
			if ( t > 0 )
			{num[len]=t;len++;} 
		}
		j = len; 
		while ( num[j] == 0)
			j--; 
		for ( ; j >= 0; j-- )
			cout << num[j]; 
		cout << endl;
	}
	return 0;
}
int a[101],b[101];//b??????
int n;
void f(int i)
{
	int j;
	if(i==n)
		return;
	else
	{

		for(j=0;j<101;j++)
			b[j]=0;
		for(j=100;j>=0;j--)
		{
			a[j]=a[j]*2+b[j];//????
			if(a[j]>=10)
				{a[j]=a[j]-10;
			b[j-1]=1;}
		}
		f(i+1);
	}
}
int main()
{
	cin>>n;
	a[100]=1;
	f(0);
	int i;
	for(i=0; ;i++)
	{
		if(a[i]!=0)
			break;
	}
	for(i;i<=100;i++)
		cout<<a[i];
}
int a[1000];
void jisuan(int a[])
{
	int l,i,flag;
	for(i=999;i>=0;i--)
	{
		if(a[i]!=0)
		{   l=i;
			break;
		}
	}
	a[0]=a[0]*2;
	flag=a[0]/10;
	a[0]=a[0]%10;
    for(i=1;i<=l+1;i++)
	{
		a[i]=2*a[i]+flag;
		flag=a[i]/10;
		a[i]=a[i]%10;
	}
}
int main()
{
	int N,i,l;
    cin>>N;
	for(i=0;i<1000;i++)
		a[i]=0;
	a[0]=1;
	for(i=0;i<N;i++)
		jisuan(a);
	for(i=999;i>=0;i--)
	{
		if(a[i]!=0)
		{
			l=i;
			break;
		}
	}
	for(i=l;i>=0;i--)
		cout<<a[i];
	return 0;

}
void Multiply(int[50]);

int main()
{
	int n, num[50] = {0}, i;
	num[0] = 1;
	cin >> n;
	for(i = 1; i <= n; i++)
	{
		Multiply(num);
	}
	i = 49;
	while(num[i] == 0) i--;
	for(; i >= 0;)
	{
		cout << num[i--];
	}
	return 0;
}

void Multiply(int num[50])
{
	int i;
	for(i = 0; i < 50; i++)
	{
		num[i] *= 2;
	}
	for(i = 0; i < 50; i++)
	{
		if(num[i] >= 10)
		{
			num[i + 1] += num[i] / 10;
			num[i] = num[i] % 10;
		}
	}
	return;
}
int main(){
	int n;
	cin>>n;
	if(n==0){
		cout<<1<<endl;return 0;
	}
	n--;
	static int a[1000],b[1000];
	for(int i=0;i<1000;i++)a[i]=0;
	a[0]=1;a[1]=2;
	while(n){
		n--;
		for(int i=0;i<1000;i++)b[i]=0;
		b[0]=a[0];
		for(int i=1;i<=a[0];i++){
			b[i]+=a[i]*2;
			b[i+1]+=b[i]/10;
			b[i]%=10;
		}
		if(b[a[0]+1]>0)b[0]++;
		for(int i=0;i<1000;i++)a[i]=b[i];
	}
	for(int i=a[0];i>=1;i--){
		cout<<a[i];
	}
	cout<<endl;
	return 0;
}
int main()
{
    int N;
    cin>>N;
    int a[500]={0};
    int b[500]={0};
    if(N==0)cout<<"1";
    else 
    {
    a[0]=2;
    for(int i = 0 ; i < N-1 ; i++)
    {
            for(int j = 0 ; j < 500 ; j++)
            {
                    if((a[j]*2)<10)a[j]=a[j]*2;
                    else 
                    {
                         a[j]=(a[j]*2)%10;
                         b[j+1]=1;
                    }
            }
            for(int j = 0 ; j < 500 ; j++)a[j]=a[j]+b[j],b[j]=0;
    } 
    int flag=0;
    for(int i = 499 ; i >= 0 ; i--)
    {
            if(a[i]!=0 || flag==1)
            {
                       flag=1;
                       cout<<a[i];
            }
    }
}
    return 0;
}
char a[50], b[50];
void f()
{
	int i, y;
	for (i = 0; i < 50; i++)
		b[i] = '0';
	for (i = 49; i >= 0; i--)
	{
		y = (a[i] - '0') * 2;
		if (i > 0)
		{
			b[i - 1] += y / 10;
			b[i] += y % 10;
		}
		if (b[i] - '0' > 9)
		{
			b[i - 1]++;
			b[i] -= 10;
		}
	}
	for (i = 0; i < 50; i++)
		a[i] = b[i];
}
int main()
{
	int n, i, j;
	cin >> n;
	for (i = 0; i < 50; i++)
		a[i] = '0';
	a[49] = '2';
	if (n == 0)
		cout << "1" << endl;
	else if (n == 1)
		cout << "2" << endl;
	else
	{
		for (i = 1; i < n; i++)
			f();
		for (i = 0; i < 50; i++)
			if (a[i] != '0')
				break;
		for (j = i; j < 50; j++)
			cout << a[j];
		cout << endl;
	}
	return 0;
}
int main()
{
   int m,n,i,j,k,jin; 
   int a[35],b[35];//n????????
   cin>>m;
   for(i=1;i<35;i++)a[i]=0;
   a[0]=2;
   for(i=1;i<m;i++)
   {
	   jin=0;
      for(j=0;j<35;j++)
	  {
	      b[j]=(2*a[j]+jin)%10;
		  jin=(2*a[j]+jin)/10;
	  }
      for(j=0;j<35;j++)
	  {a[j]=b[j];}

   }
   for(i=34;i>=0;i--)
   {
      if(a[i]!=0)break;
   }
   if(m==0)cout<<1;
   else if(i==-1)cout<<a[0];
   else
   {
	   for(j=i;j>=0;j--)cout<<a[j];
   }
   
return 0;
}
/**
 * @file        5.cpp
 * @author      ???
 * @date        2013-11-13
 * @description ?????????2?N??
 */
int main(void)
{
    int N, a[100] = {0}, i, k;
    a[99] = 1;
    cin >> N;
    for( i = 0 ; i < N ; i++ )
    {
        for( k = 1 ; k <= 100 ; k++ )
            a[100 - k] *= 2;
        for( k = 1 ; k <= 100 ; k++ )
            if( a[100 - k] > 9 )
            {
                a[99 - k] += a[100 - k] / 10;
                a[100 - k] %= 10;
            }
    }
    for( k = 0 ; k < 100 ; k++ )
        if( a[k] )
            break;
    for( ; k < 100 ; k++ )
        cout << a[k];
    return 0;
}
/***************************??2?N??**********************
??
??????????N(N<=100)???2?N?????
????
??????????N?
????
??2?N?????
????
5
????
32
??
?????
***********************************************************
programmer Qiu HEzi
version 1.0
creat time 2012.12.21 1:14
***********************************************************/
void c (char *temp , int num)
{
    *temp = '0' +num;
}
int fun (char a[110] , int w)
{
    int plu =0 ; //????????1
    for (int i=0 ; i<w ; i++)
    {
        int temp = (a[i]-'0')*2 +plu;
        if (temp>=10)
        {
            plu=1;
            temp-=10;
        }
        else
            plu=0;
        a[i]=temp+'0';
    }
    if (plu==1)
    {
        w++;
        a[w-1]='1';
    }
    return w;
}
int main()
{
    int n;
    cin>>n;
    char a[110]={0};
    a[0]='1';
    int w=1 ;//???????
    for (int i=0 ; i<n ; i++)
        w = fun (a , w);
    for (int i=w-1 ; i>=0 ; i--)
        cout<<a[i];
    return 0;
}
/*
 * 3.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */


int main()
{
	int n;
	cin >> n;
	int i, j, k;
	char ans[1000];
	int tans[1000];
	ans[0] = 1 + '0';
	ans[1] = '\0';
	for (i = 0; i < n; i++) {
		int len = strlen(ans);
		for (j = 0; j < len; j++) {
			tans[j] = (ans[j] - '0') * 2;
		}
		int carry = 0;
		for (j = 0; j < len; j++) {
			int carrytem = tans[j] / 10;
			tans[j] = (tans[j] + carry) % 10;
			carry = carrytem;		}

		if (carry == 1) {
			tans[j] = 1;
			j++;
		}

		for (k = 0; k < j; k++) {
			ans[k] = tans[k] + '0';
		}
		ans[j] = '\0';
	}
	int lentem = strlen(ans);
	for (i = lentem - 1; i >= 0; i--)
		cout << ans[i];
	return 0;
}
/**
* ??????
* ???1000012847
* ?????2?N??
*/

int g_pos = 38;    //??????????num[]???????0???

//?????2????????????????
void Pow(int [] , int);
int main()
{
	int n;
	cin >> n;                 //??N????2?n??
	
	int num[40] = {0};        //?????40?????????0
	num[38] = 1;              //?39????1

	Pow(num , n);             //???????????
	
	for(int j = g_pos; j < 39; j++)
		cout << num[j];         //?????????????????

	cout << endl;             //??????

	return 0;
}

void Pow(int num[] , int n)
{
	int i;

	if(n == 0)                 //n?0?????
		return;

	for(i = 39; i >= g_pos; i--)    //?????????????2
	{
		num[i - 1] = num[i - 1] * 2 + num[i] / 10;  //?????2????????
		num[i] %= 10;                             //????10??
	}

	g_pos = 0;
	while(num[g_pos] == 0)
		g_pos++;                       //???2????????????????

	Pow(num , n - 1);                //??????????1
}
//**********************************
//*  ????homework_5.cpp        *
//*  ??????1200012884        * 
//*  ?????2012?12?17?      *
//*  ???????2?N?? 
//**********************************
int main()
{
	int n, temp, len;
	cin >> n;
	int i, j;
	int a[100] = {0};
	a[0] = 1;
	len = 1;
	for (i = 0;i < n;i++)
	{
		temp = 0;
		for (j = 0;j < len;j++)
		{
			a[j] = a[j] * 2 + temp;
			temp = floor(a[j] / 10);
			a[j] = a[j] % 10;
		}
		if (temp > 0)
		{
			a[j] = temp;
			len++;
		}
	}
	for (i = len - 1;i >= 0;i--)
		cout << a[i];
	cout << endl;
	return 0;
}
void bigmulti(char a[],char b[],char c[])
{
    int i,tem[400],j,k,la=strlen(a),lb=strlen(b);
    int sum[800],num1[400],num2[400];
    memset(sum,0,sizeof(sum));
    memset(num1,0,sizeof(num1));
    memset(num2,0,sizeof(num2));
    for(i=0;i<la;i++)
    num1[i]=a[la-1-i]-'0';
    for(i=0;i<lb;i++)
    num2[i]=b[lb-1-i]-'0';
    for(i=0;i<lb;i++)  
    {
        memset(tem,0,sizeof(tem));
        tem[0]=num1[0]*num2[i];
        for(j=1;j<=la;j++)
        {
            tem[j]=num1[j]*num2[i]+tem[j-1]/10;
            tem[j-1]%=10;
        }
        for(j=0;j<=200;j++)
        {
            if(j==0&&i==0)
            sum[0]=tem[0];
            else
            {
                sum[i+j]=sum[i+j]+tem[j]+sum[i+j-1]/10;
                sum[i+j-1]%=10;
            }
        }
    }
    for(i=la+lb;i>=0&&sum[i]==0;i--);
    c[i+1]='\0';
    for(j=0;j<=i;j++)
    c[i-j]=sum[j]+'0';
}
    
int main()
{
    int n,i;
    char s[1000]="1",a[1000];
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        bigmulti(s,"2",a);
        strcpy(s,a);
    }
    printf("%s",s);
    return 0;
}
int main()
{
	int n,num1,num2,s=0;;
	char a[110];
	for(int i=1;i<=109;i++)
		a[i]='*';
	cin>>n;
	int t=1;
	int sig;
	a[1]='2';
	if(n==1)
		cout<<2<<endl;
	else
	{
		if(n==0)
			cout<<1;
		else
		{
			for(int i=1;i<=n-1;i++)
			{
				sig=t;
				for(int j=1;j<=sig;j++)
				{
					num1=a[j]-48;
					num1=num1*2+s;
					s=0;
					if(num1<10)
						a[j]=num1+48;
					else
					{
						a[j]=num1+38;
						if(a[j+1]=='*')
						{
							a[j+1]='1';
							t++;
						}
						else
						{
							s=1;
						}
					}
				}
			}
			for(int i=109;i>=1;i--)
			{
				if(a[i]!='*')
				{
					cout<<a[i];
				}
			}
		}
	}
	return 0;
}
int x[10000]={0};
int b=1;
void f(int a,int n){
	int i;
	if(n==1); 
	else {
	for(i=0;i<a;i++)x[i]=x[i]*2;
	for(i=0;i<a;i++){
		if(i<a-1){
		if(x[i]>=10){
			x[i]-=10;
			x[i+1]+=1;}
		}
		else {
			if(x[i]<10)f(a,n-1);
			else {x[i+1]=1;
			x[i]-=10;
			b++;
			f(a+1,n-1);
			}
		}
	}}
	
}
int main()
{
	int i,j,n,a,q,m,g,k,h;
	scanf("%d",&n);
	if(n==0)printf("1");
	else{
	x[0]=2;
	f(1,n);
	for(i=b-1;i>=0;i--){
		printf("%d",x[i]);}
	}	

}
int main()
{
 char word[100],answord[100];
  gets(word);
  int len=strlen(word);
  int i=0,anslen=0;
  answord[0]=word[0];
  anslen++;
  for(i=1;i<len;i++)
  {
   if(word[i]==' '&&word[i-1]==' ')
    continue;
   else 
    answord[anslen++]=word[i];
  }
  answord[anslen]='\0';
  puts(answord);
  return 0; 
}
int main()
{
	char str[301];
	char *p = NULL, *q = NULL, *r = NULL;
	int count;
	cin.getline(str,101);
	int a = strlen(str);
	p = str;
	while(*p != '\0')
	{
		count = 0;
		if(*p == ' ')
		{
			for(r = p; *r == ' '; r++)
				count++;
			for(;r < str + 4 * a; r++)
				*(r - count + 1) = *r;
		}
		p++;
	}
	cout << str << endl;
	return 0;
}
int main()
{
	char i,c,t=0,str[100];                  //??????????
	for(i=0;i<=t;i++)
	{
		str[i]=cin.get();
		t=t+1;
		if(str[i]=='\n')                //?????????????
			break;
	}
	for(i=0;i<t;i++)
	{
		if(str[i]!=' ')
			cout<<str[i];
		if(str[i]==' ')
		{
			if(str[i-1]!=' ')   //???????????????
				cout<<str[i];
			if(str[i-1]==' ')            //??????????
				continue;
		}
	}

	return 0;
}
/*
 * GUOLV.cpp
 *
 *  Created on: 2010-11-19
 *      Author: 10211
 */

int main(){
	char a[101];
	cin.getline(a,101);
	int la;
	la=strlen(a);
	for(int i=0;i<la;i++){
		if(a[i]==' ')
			if(a[i+1]==' '){
				for(int j=i;j<la;j++)
					a[j]=a[j+1];
				la--;
				i--;
			}

	}
	for(int i=0;i<la;i++)
	cout<<a[i];
	return 0;
}
int main(){
  char str[101],str1[101]; 
  int i,n,m,e; 
  gets(str);
  n=strlen(str);
  m=0;
  for(i=1;i<=n;i++){
    if(str[i]==' '&&str[i-1]==' ')
    continue;
    else{
    str1[m]=str[i];
    m++;                 
  } 
} printf("%c",str[0]);
  puts(str1);
  return 0;   
}
int main()
{
   char str1[200],str2[100][20];
   cin.getline(str1,200);
   int le,i,j,k=0;
   le=strlen(str1);
   for(i=0;i<=le-1;i++)
   {
	   if(i==0||(str1[i-1]==' '&&str1[i]!=' '))
		   {
		         for(j=0;j<=19;j++)
		         {
		        	 if(str1[i+j]!=' '&&str1[i+j]!='\0')
		        		 str2[k][j]=str1[i+j];
		        	 else
		        	 {
		        		 str2[k][j]='\0';
		        		 k=k+1;
		        		 break;
		        	 }

		         }
		   }
   }
   cout<<str2[0];
   for(i=1;i<=k-1;i++)
	   cout<<" "<<str2[i];
   return 0;
}
int main()
{
	int i,p,n;
	char ori[101],tra[101];
	gets(ori);
	n=strlen(ori);
	tra[0]=ori[0];
	p=1;
	for(i=1;i<=n;i++)
	{
		if(ori[i]!=' '||ori[i-1]!=' ')
		{
			tra[p]=ori[i];
			p=p+1;
		}
		
	}
	printf("%s",tra);

	return 0;
}
int main()
{
	char a[200];
	cin.getline(a,200);
	int l,i,flag=0;
	l=strlen(a);
	for(i=0;i<l;i++)
		if(flag==0)
		{
			cout << a[i];
			if(a[i]==' ')
				flag=1;
		}
		else
			if(a[i]!=' ')
			{
				flag=0;
				i--;
			}
			cout << endl;
}
/*
				? ? ??1000012827_1.cpp
				?    ?????
				?????20101208
				????????????????
**/
int main()
{
	char *p, a[101];											//???????????
	int flag = 0;												//???????????????1
	cin.getline(a, 100);										//??????
	p = a;														//???????p
	while(*p != '\0' )											//???????????
	{
		if((*p >= 65 && *p <= 90) || (*p >= 97 && *p <= 122))	//???????
		{
			flag = 1;											//????????????
			cout << *p;
		}
		else													//??????
		{
			if(flag == 1)										//???????????
			{
				flag = 0;										//????????
				cout << *p;
			}
			else												//??????????
			{
				p++;											//????
				continue;										//????
			}
		}
		p++;													//????
	}
	return 0;
}
int main()
{
   char *p,str[110];
   int len,i;
   p=str;
   gets(str);
   len=strlen(str);
   for(i=0;i<len;i++)
   {
     if(i==0)
	    cout<<*(p+i);
	 else 
	 {
		 if((*(p+i)==' ' && *(p+i-1)!=' ') || (*(p+i)!=' '))
		 cout<<*(p+i);
		 else continue;
	 }
   }
   return 0;
}
int main ()
{
    char string[105];
    gets (string);
    int l,i,j;
    l=strlen (string);
    for (i=0;i<l;i++)
    {
        if (string[i]==' ' && string[i+1]==' ')
        {
            for (j=i;j<l;j++)
            {
                string[j]=string[j+1];
            }
            i=i-1;
        }
    }
    printf ("%s",string);
    getchar ();
    getchar ();
}
int main(int argc, char* argv[])
{
	int i,j,k;
	char str[101];
	gets(str);
	for(i=0;str[i]!='\0';i++)
	{
		if(str[i]==' ')
		{
			if(str[i+1]==' ')
			{
				for(j=i+1;;j++)
				{
					if(str[j]!=' ')
					{
						i=j;
						break;
					}
                    str[j]='0';
				}
			}
		}
	}
	for(k=0;str[k]!='\0';k++)
	{
		if(str[k]=='0')
			continue;
		else
			printf("%c",str[k]);
	}
	return 0;
}
void main()
{
    int i,n;
    char str[101];
    for(i=0;;i++)
    {
        str[i]=getchar();
        if(str[i]=='\n')break;
    }
    n=i;
    for(i=0;i<n;i++)
    {
        if(i==0)putchar(str[i]);
        else if(str[i]==' '&&str[i-1]!=' '||str[i]!=' ')putchar(str[i]);
    }
}
int main()
{
    char string[200];
    gets(string);
    int n,i,j;
    n=strlen(string);
    for(i=0;i<n;i++)
    {
                    while(string[i]==' '&&string[i+1]==' ')
                    {
                                    for(j=i+1;j<n;j++)
                                    {
                                          string[j]=string[j+1];
                                    }
                    }
                    
}
    
    
    for(i=0;i<n;i++)
    {
                  
                    if(string[i]=='\0')
                    break; 
                     printf("%c", string[i]);
    }
    return 0;
}
//????   ???  1000010334 
/*
????(1)??dev?????'\0'?  ??' ';
        (2)??grids?????'\b'???; 
*/ 
int main()
{
    int i=0;  // ??? 
    int j=0;
    char a[100];  //??????? 
    char chu=0;
    for(i=0;i<100;i++)
    {
        a[i]='\0';
    }
    i=0;
    a[0]=getchar();
    cout<<a[0];
    while(chu=getchar())
    {
        if(chu=='\n')
        {
            break;
        }
        else
        {
            a[i]=chu;
            if((a[i-1]==' '&&a[i]!=' ')||(a[i-1]!=' '))
            {
                cout.put(a[i]);
            }
            i=i+1;
        }
    }
    return 0;
}
int main()
{
	int i,j=0;
	char a[101],b[101];
	gets(a);
	for(i=0;a[i];i++)
	{
		if(!(a[i]==' '&&a[i+1]==' '))
		{
			b[j]=a[i];
			j++;
		}
	}
	b[j]='\0';
	puts(b);
}
int main()
{
    char a[100];
    int i=0,j=1,k=1,l;
    gets(a);
    l=strlen(a);
    while(a[i]!='\0')
        {
            j=1;k=1;
            if(a[i]==' ')
                {
                       while(a[i+j]==' ')
                           {
                               j++;
                           }
                       while(a[i+j+k-1]!='\0')
                           {
                               a[i+k]=a[i+j+k-1];
                               k++;
                           }
                       a[i+k]='\0';
                }
            i++;
        }
    puts(a);
    getchar();
}
int main(){
	int i,b,j,l;
	char s[MAX+1];
	char a[MAX+1];
	gets(s);
	l=strlen(s);
	b=0;
	for(i=0;i<=l;i++){
		if(s[i]!=' '){
			a[b]=s[i];
			b++;
		}
		else {
			a[b]=s[i];
			b++;
			for(j=i;s[j]==' ';j++){
			}
			i=j-1;
		}
	}
	puts(a);
	return 0;
}
main()
{
      char a[100];
      gets(a);
      for (int i=1;i<100;i++)
      {
          if(a[i]==' ' && a[i-1]==' ')
          {
              for (int j=i;j<100;j++)
              {
                  a[j]=a[j+1];
              }
              i=i-1;
          }
      }
      puts(a);
      getchar ();
}
int main()
{
char a[101],b[101];
int c,d=0,i,j=0;
gets(a);
c=strlen(a);
for(i=0;i<101;i++)
{b[i]=0;}
if(a[0]!=' ')
{b[0]=a[0];
j++;}
for(i=1;i<c;i++)
{if(a[i]!=' '||a[i]==' '&&a[i-1]!=' ')
{b[j]=a[i];
j++;}}
for(i=0;i<101;i++)
{if(b[i]!=0)
printf("%c",b[i]);}

return 0;
}
int main()
{
	char st[101];
	int i;
	gets(st);
    i=0;
	while (st[i]!='\0')
	{
		if ((st[i]!=' ')||(st[i-1]!=' ')) printf("%c",st[i]);
		i++;
	}
	return 0;
}
void main()
{
	int i,l,k=0;
	char a[101]={0};
	char b[101]={0};
	gets(a);
    l=strlen(a);
	for(i=0;i<l;i++)
		if(a[i]!=' '||a[i-1]!=' ')
		{
			b[k]=a[i];
			k++;
		}
	puts(b);
}
int main()
{
	char str[101];
	int i,flag=1,j=0;
	gets(str);

	for(i=0;str[i]!='\0';i++)
	{
		if(str[i]==' ')
		{
			flag=0;
			j++;
		}
		else 
		{
			j=0;
			flag=1;
		}
		if(!(flag==0&&j>1))
			printf("%c",str[i]);
	}
}
int main()
{
  int i,j,a,b,c,n;
  a=0;
  char u[101],w[101];
  gets(u);
  n=strlen(u);
  w[0]=u[0];
  for(i=1;i<=n;i++)
  {if((u[i]!=' '||u[i-1]!=' ')&&(i<n))
    {
	  a=a+1;
    w[a]=u[i];
     }
   else if(i==n) {
	   a=a+1;
	   w[a]='\0';
   }
    }

  puts(w);
  return 0;
}
int main()
{
	int i,j;
	char a[101];
	char d[101];
	char e[250];
	e[0]='\0';
	gets(a);
	strcat(a," ");
	for(i=0;a[i]!='\0';)
	{
		if(a[i]!=' ')
		{
			for(j=i;a[j]!=' ';)
				
			{
				d[j-i]=a[j];
				j++;
			}
			
			d[j-i]='\0';
			
			strcat(e,d);
			if(a[j+1]!='\0')
			{
				strcat(e," ");
			}
			i=j+1;
		}
		else
			i++;
		
	}
	puts(e);
	return 0;
}
int main()
{
	char a[101];
	cin.getline(a,101);
	int length = strlen(a);
	char *p = a;
	int flag = 0;
	for(int i = 1 ; i<=length ; i++ , p++)
	{
		if(*p!=' ')
		{
			cout<<*p ;
			flag = 0 ;
		}
		if((*p==' ')&&(flag==0))
		{
			cout<<*p ;
			flag = 1 ;
		}
	}
	return 0 ;
}
int main()
{
   char str[100];                     //??????
   int i,j,m=1;                        //??????i,j?m??????
   cin.getline(str,100);
   for(i=0;str[i]!='\0';)               //???????????????????????????????????????????
   {
	   m=1;
	   if(str[i]==' '){
		   for(j=1;str[i+j]==' ';j++)
			   m++;
		   cout<<str[i];
		   i+=m;
	   }
	   else cout<<str[i++]; 
   }
   return 0;
}
int main()
{
    int l,i,j;
    char a[100];
    gets(a);
    l=strlen(a);    
    for(i=1;i<l;i++)
        if(a[i-1]==' '&&a[i]==' ')
        {
            for(j=i;j<l;j++)
                a[j]=a[j+1];
            i--;
        }
    puts(a);
}
int main()
{
	char mystring[101];
	gets(mystring);
	char * p=mystring;
	for (;*p!='\0';p++)
	{
		if (p==mystring) cout<<*p;
		else if (*p!=' ') cout<<*p;
		else if (*(p-1)!=' ') cout<<*p;
	}
	return 0;
}
int main() {
char a[101] ;
gets(a);
char b=a[0];
for(int i=0;a[i];i++){
if((b==' ')&&(a[i]==' ')){
continue;
}else{
printf("%c",a[i]);
b=a[i];
}
}
printf("\n");
return 0;
}
int main()
{
	char ch[101], i, j, q;
	cin.getline(ch,101);
	for(i = 0; ch[i] != '\0'; i++)
	{
		if(ch[i] == ' ')
		{
			if(ch[i+1] == ' ')
			{
				for(j = i; j < 101; j++)
				{
					ch[j] = ch[j + 1];
				}
				i--;
			}
		}
	}
	q = i;
	for(i = 0; i < q; i++)
	{
		cout << ch[i];
	}
	return 0;
}
/**
* ??????
* ???1000012847
* ??????????
**/
int main()
{
	char *p , str[101];      //??????*p??????str[101]
	int flag = 0;            //????flag????????
	
	cin.getline(str , 101);    //?????

	p = str;                  //????????????

	for(; *p != 0; p++)        //??????????????1
	{
		if(*p == ' ')          //??????
			if(flag == 0)       //????0?????????
			{
				cout << *p;    //????????1
				flag = 1;
			}

		if(*p != ' ')          //???????
		{
			cout << *p;        //?????????
			flag = 0;
		}
	}
	cout << endl;              //??????

	return 0;
}