Created
October 5, 2012 03:05
-
-
Save Abreto/3837827 to your computer and use it in GitHub Desktop.
分隔单词
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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