标签:blog io ar for on div log as tt
#include <stdio.h> #include <string.h> void deblank(char string[]) { const int tmp=strlen(string); for (int i = 0; i <=tmp; ++i) { if (string[i]==‘ ‘) { if (string[i+1]==‘ ‘) { for (int j = i+1;j<=tmp;j++) string[j]=string[j+1]; i--; continue; } } else continue; } } int main(void) { char chars[1000]; gets(chars); deblank(chars); for (int i = 0; i < strlen(chars); ++i) { printf("%c",chars[i]); } return 0; }
标签:blog io ar for on div log as tt
原文地址:http://www.cnblogs.com/visionsmile/p/4164433.html