View Code of Problem 43

#include<stdio.h>  
#include<string.h>  
int main()  
{  
    char s[80],s2[80];  
    int len,j=0;  
    int i;
    gets(s);  
    len = strlen(s);  
    for (i = 0; i < len; i++)  
    {  
        if ('A'<=s[i]&&s[i]<='Z'||'a'<=s[i]&&s[i]<='z')  
        {  
            s2[j] = s[i];  
            j++;  
        }  
    }  
    s2[j] = '\0';  
    printf("%s\n", s2);  
    return 0;  
}

Double click to view unformatted code.


Back to problem 43