#include<stdio.h> #include<math.h> #include<string.h> int main() { char s[1000]; char a[1000]; int i, j = 0; gets(s); int n = strlen(s); for (i = 0; i < n; i++) { if ((s[i] >= 'a'&&s[i] <= 'z') || (s[i] >= 'A'&&s[i] <= 'Z')) { a[j] = s[i]; j++; } } a[j] = '\0'; puts(a); printf("\n"); return 0; } |
Double click to view unformatted code.