在這裏,我得到元音的答案,但不是繼續它說錯誤的繼續和休息。我正在學習C語言,但我不能運行'y'來繼續程序
#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;
}
'while(true)'better better? –
當然!如果編譯器對此感到滿意。 – Shaggy
代碼的縮進可以改進。 – alk