#include <stdio.h> #include <ctype.h> int main() { char Str[80] = "l'agorithme de djikstra en C/C++"; char *pStr1 = Str; char *pStr2 = Str; while(*pStr1 != ' ') { if(ispunct(*pStr1) || isspace(*pStr1)) { ++pStr1; continue; } else *pStr2++ = *pStr1++; } *pStr2 = ' '; printf("%sn", Str); return 0; } |
----------------------------------------------------------------------------