Home > Back-end >  How to remove the letters and the back of the * * front not to go
How to remove the letters and the back of the * * front not to go

Time:12-19

This is too difficult, I was a novice,

CodePudding user response:

//letters in the middle and the back of the front not to 
* remove#include
#include
Int main () {
Char * s="ab fghijklmn cde * * * * * * *";
Char t [80], c;
Int I, j, L, st.

L=strlen (s);
J=0;
St=0;
for (i=0; iC=s [I];
The switch (st) {
Case 0:
If (c!='*') {
T [j++]=c;
St=1;
} else {
T [j++]=c;
}
break;
Case 1:
If (c!='*') {
T [j++]=c;
}
break;
}
If (j>=80-1) break;
}
T [j]=0;

Printf (" % s \ n ", t);//* * abcdefghijklmn
return 0;
}
  • Related