C-语言题目---连续键入字母,并且以‘0’结束,并且将大写字母,小写字母其他字母筛选出来

#include 
int main() {
    int j,k=0,l=0,m=0,n=0;
    char c,b[100],d[100],e[100],f[100];
    printf("Please input letter:\n");
    printf("if letter=0 ENd\n");
    while((c = getchar()) != '0') {
        if((c >= 'A' && c <= 'Z')) {
                b[k++]=c;
        }
        else
        if((c >= 'a' && c <= 'z')){
                d[l++]=c;
        }
        else
        if((c >= '0' && c <= '9')){
                e[m++]=c;
        }
        else
                f[n++]=c;
    }

    if(c=='0') {
    			printf(" %s",b);
                printf(" %s",d);
                printf(" %s",e);
                printf(" %s",f);
        for(j=0;j

C-语言题目---连续键入字母,并且以‘0’结束,并且将大写字母,小写字母其他字母筛选出来_第1张图片很神奇这个输出很想知道%s哪里为啥有一些乱码,明天在检查一下改一下

你可能感兴趣的:(总结)