Write+a+C+program+that+displays+the+input.+The+process+stops+when+the+number+999+is+typed+in
时间: 2023-11-18 20:03:34 浏览: 67
3nplus1_3n+1_
以下是一个C语言程序,可以实现输入数字并在输入999时停止:
```c
#include <stdio.h>
int main() {
int num;
printf("请输入数字:\n");
while (1) {
scanf("%d", &num);
if (num == 999) {
break;
}
printf("输入的数字是:%d\n", num);
}
printf("程序已停止。\n");
return 0;
}
```
阅读全文