出色地,
printf
除了我最后一次打电话外,这里一切正常。我想在这段代码中输出删除的字符:
#include <stdio.h>
int del_lower_vowels(char c) {
if(c=='a') {
return 0;
}
if(c=='e') {
return 0;
}
if(c=='i') {
return 0;
}
if(c=='o') {
return 0;
}
if(c=='u') {
return 0;
}
else
return c;
}
int main (void) {
printf("Enter a string\n");
int c;
int del = 0;
while((c=getchar()) != EOF)
{
c = del_lower_vowels(c);
if(c==0)
{
del +=1;
}
putchar(c);
}
printf("Deleted characters: %d",del);
return 0;
}