在dvc++中编写一个程序

dvc++中,输入一个字符串,保留元音字母后输出字符串及其长度,怎么编写程序啊?


#include <stdio.h>

int main()
{
    char s[100],ch;
    int len1=0,len2=0;
    while((ch=getchar())!='\n')
    {
        if(ch=='a' || ch == 'o' || ch == 'e' || ch == 'i' || ch == 'u' ||
            ch=='A' || ch == 'O' || ch == 'E' || ch == 'I' || ch == 'U')
        {
            s[len2++]=ch;
        }
        len1++;
    }
    s[len2]='\0';
    printf("%s\n%d",s,len2);

    return 0;
}

#include <stdio.h>
#include <string.h>
int main()
{
char str[100]="";
scanf("%s",str);
for(int i=0;i<strlen(str);i++)
{
if(str[i]=='a'||str[i]=='e'||str[i]=='u'||str[i]=='i'||str[i]=='o')
continue;
printf("%c",str[i]);
}
printf("字符串的长度为%d",strlen(str));
}