在 C 語言中,輸入一個英語句子可以使用`gets`函數或`scanf`函數。以下是示例代碼:
使用`gets`函數:
```c
#include
#include
int main() {
char str[50];
printf("請輸入英文句子(以回車結束):\n");
gets(str);
// 后續可對輸入的句子進行處理
return 0;
}
```
使用`scanf`函數:
```c
#include
#include
int main() {
char str[50];
printf("請輸入英文句子(以回車結束):\n");
scanf("%s", str);
// 后續可對輸入的句子進行處理
return 0;
}
```
點擊前往免費閱讀更多精彩小說