#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
char a[]="
gr fr frrfr f r frfr " ;
int
i,j,k,n;
n=strlen(a);
printf(" the len is %d",n);
for(i=0;i<n;)
{
if(a[i]==' ' && a[i+1]==' ')
{
for(j=i;j<n;j++)
{
a[j]=a[j+1];;
}
n--;
}
else
i++;
}
if(a[0]==' ')
{
for(i=0;i<n;i++)
{
a[i]=a[i+1];
}
n--;
}
a[n-1]='\0';
n=strlen(a);
printf(" the len is
%d",n);
printf("\n\n");
puts(a);
getch();
return 0;
}
No comments:
Post a Comment