You are on page 1of 1

#include<iostream>

#include<string.h>
using namespace std;
int main(){
char s[256];
int i, k=-1, kc, sw, n;
cin.get(s,256);
cin.get();
kc=0;
n=strlen(s);
for(i=0; i<n; i++){
if(s[i]!=' ')
{kc++; sw=0; k++;}
else
/*if(s[i]!='\0')
{kc++; sw=0; k++;}
else*/
{sw=1;}
cout<<k<<" "<<kc<<" "<<sw<<" "<<endl;
if(sw==1)
if(kc%2!=0)
{strcpy(s+k-kc/2,s+k-kc/2+1); kc=0; i--;
//cout<<"da "; //kc=0;
}
//else
//cout<<"nu ";
}
/*for(i=0; i<n; i++)
if(s[i]=='a')
strcpy(s+i,s+i+1);*/
cout<<s;
return 0;
}

You might also like