解決這對我來說,因爲我真的不知道有人可以解決這個代碼塊?
#include <stdio.h>
#include <stdlib.h>
int main() {
char ans;
printf("1. The patients felt _____ after taking the medicine.\n");
printf("\t a. best\n\t b. better\n\t c. good\n\n");
scanf("%c", &ans);
if (ans == 'b') {
printf("2. I ______ my essay by the time the bell rings.\n");
printf("\t a. have done\n\t b. shall do\n\t c. shall have done\n\n");
scanf("%c", &ans);
} else {
printf("YOU FAILED!");
};
return 0;
}
如果你回答您下次繼續對第一個問題,回答第二個問題,但問題是,即使有我不能鍵入答案scanf
。
刪除你的分號後你的分號,然後嘗試運行,我能夠正確運行你的代碼,並給出了答案,再次嘗試運行 –
用適當的標題更新您的查詢。 – Prasad
不要更改代碼在問題中,使用** EDIT **段落添加到問題中,修改問題使評論和回答不一致。 – chqrlie