You are on page 1of 1

#include <iostream> using namespace std; #include<conio.h> #include<stdio.

h> void xoabokhoangtrang(char *xau) { char *temp=(char*)malloc(strlen(xau)+1); int k=0; for(int i=0;i<strlen(xau);i++) if (xau[i]!=32) temp[k++]=xau[i]; temp[k]=0; strcpy(xau,temp); free(temp); } void main() { char xau[100]; gets(xau); xoabokhoangtrang(xau); cout<<xau; getch(); }

You might also like