在这里我得到了元音的答案,但没有得到继续的答案,它说继续和中断都有错误。
#include < stdio.h >
main() {
char c, d;
printf("say your word to find the vowels\n");
scanf("%c", & c);
if (c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' || c == 'I' || c == 'o' || c == 'O' || c == 'u' || c == 'U')
printf("you got a vowel\n");
else
printf("cool no vowel word\n");
printf("continue\n");
printf("(y/n)\n");
scanf("%c", & d);
if (d == 'y' || d == 'Y')
continue;
else
break;
return 0;
}
最佳答案
if (d == 'y' || d == 'Y')
continue; // where?
else
break; // what?
您的主函数中没有任何内容可以继续
或中断
。
continue
和 break
都只在循环内有意义,因此您应该在 main()
重复整个过程,直到用户决定退出。
关于c - 我正在学习 C 语言,但无法运行 'y' 来继续程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39555131/