Home > Back-end >  Bosses ask what went wrong
Bosses ask what went wrong

Time:11-13

Delete a string of punctuation, remove redundant space (multiple consecutive Spaces or punctuation, keep only one space) can now remove the Spaces, but delete not to drop punctuation is
o...Single to remove punctuation and Spaces can be written, set up and can't remove punctuation!
#include
Int main ()
{
int i,j;
Char STR [80].
The fgets (STR, sizeof (STR), stdin);
for(i=0; STR [I]!='\ 0' & amp; & i<80; I++)
{
If ((STR [I] & gt;='a' & amp; & STR [I] <='z') | | (STR [I] & gt;='A' & amp; & STR [I] <='Z') | | (STR [I] & gt;='0' & amp; & STR [I] <='9') | | (STR [I]==32))
{
If (STR [I]==32 & amp; & STR [I + 1)==32)
{
for(j=i; STR [j].=EOF. J++)
If (STR [j].=32)
break;
For (j; STR [j].=EOF. J++)
{
STR=STR [I + 1] [j];
i++;
}
}

}

} printf (" % s ", STR);


return 0;
}

CodePudding user response:

Punctuation is not to enter the if ((STR [I] & gt;='a' & amp; & STR [I] <='z') | | (STR [I] & gt;='A' & amp; & STR [I] <='Z') | | (STR [I] & gt;='0' & amp; & STR [I] <='9') | | (STR [I]==32)), so the punctuation is not to do any processing,

CodePudding user response:

reference 1st floor qybao response:
punctuation did not enter the if ((STR [I] & gt;='a' & amp; & STR [I] <='z') | | (STR [I] & gt;='A' & amp; & STR [I] <='Z') | | (STR [I] & gt;='0' & amp; & STR [I] <='9') | | (STR [I]==32)), so the punctuation is not to do any processing,

Should be how to modify the

CodePudding user response:

See the indentation devoid of code, immediately creepy,,,
  • Related