自动检票机

image

点击查看代码
#include<stdio.h>
int cnt[10];
int op;
int main(){
	while(1){
		scanf("%d",&op);
		if(!op)break;
		if(op < 20220 || op > 20229){puts("凭证无效");continue;}
		cnt[op-20220] ++;
		if(cnt[op-20220] > 1){puts("凭证无效");
		else puts("您可以入场了");
	}
}
posted @ 2023-01-03 16:26  Keith-  阅读(30)  评论(0编辑  收藏  举报