Skip to content

Instantly share code, notes, and snippets.

@Abreto
Created October 5, 2012 03:05
Show Gist options
  • Save Abreto/3837827 to your computer and use it in GitHub Desktop.
Save Abreto/3837827 to your computer and use it in GitHub Desktop.
分隔单词
/* Program E6-2. */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void)
{
int i = 0;
char str[100] = {0};
gets(str);
for( i=0 ; i<strlen(str) ; i++)
if( isalpha(str[i]) )
printf("%c", str[i]);
else if( str[i] == ',' )
printf("\n");
printf("\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment