#include<stdio.h> #include<string.h> #include<math.h> #include<algorithm> using namespace std; int main() { char str[100]; char an[100]; scanf("%s",str); int j = 0; for(int i =0;i<strlen(str);i++) { if((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z')) { an[j++] = str[i]; } an[j] = '\0'; } printf("%s\n",an); } |
Double click to view unformatted code.