70,020
社区成员




#include <stdio.h>
#include <string.h>
char* slove( char* s )
{
char *p1 = s , *p2 = s;
while( *p2 == ' ' ) ++p2;
if( !*p2 ) return *s = 0 , s;
*p1++ = *p2++;
for( ; *p2 ; ++p2 )
if( *p2 != ' ' || p1[-1] != ' ' )
*p1++ = *p2;
p1[ p1[-1]==' '?-1:0 ] = 0;
return s;
}
int main()
{
char line [ 1024 + 1 ] = "";
while( gets( line ) )
{
int len = strlen( line );
printf( "result : [[[%s]]]\n" , slove(line) );
}
return 0;
}
while(...)
{
switch(ch)
{
case 0x20:
//,.,,,,
break;
}
}