用c语言写程序,学生的学号为20221446-20221504以及20221714-20221801;运行该程序按q退出,按其他键则继续点名
时间: 2024-06-03 13:09:08 浏览: 119
可以使用如下代码来实现:
#include <stdio.h>
#include <stdlib.h>
int main() {
int start = 20221446;
int end = 20221801;
int current = start;
while (current <= end) {
printf("当前点到的学生学号为:%d\n", current);
char input = getchar();
if (input == 'q') {
break;
}
current++;
}
return 0;
}
如果您需要更详细的讲解或者有其他问题,欢迎再问我。
阅读全文
相关推荐





