Home > Back-end >  Bosses of new whole not really understand this two zha dozen
Bosses of new whole not really understand this two zha dozen

Time:11-12

First, enter a string, remove the punctuation, and outputs the processed string
The second is the discrepancy of one character string punctuation, remove redundant space
Can't use library functions, pointer what also not too will use, can now only in addition to the punctuation of the output, the others really silly
#include
Int main ()
{
int i;
Char s [80];
The scanf (" % s ", s);
If ((s [I] & gt;='a' & amp; & S [I] <='z') | | (s [I] & gt;='A' & amp; & S [I] <='Z'))
Printf (" % s ", s);
The else printf (" ");





return 0;

CodePudding user response:

Change
The scanf (" % s ", s);
for(i=0; i<80 & amp; & S [I]!='\ 0'; I++) {//to use cycle
If ((s [I] & gt;='a' & amp; & S [I] <="z") | | (s [I] & gt;='A' & amp; & S [I] <="Z") | | (s [I] & gt;='0' & amp; & S [I] <='9'))
Printf (" % c ", s [I]);
}
  • Related