📄 main.c
字号:
/*03.Start List 卢俊凯 实验四班 6070410427*/
#include "myfun.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <conio.h>
#include <stdlib.h>
#define MAX_NUM 100
int main()
{
char t ;
int num = 0;
int flag = 0;
struct equipage record[MAX_NUM] ; /*定义结构体数组*/
do
{
PrintMenu(); /*打印菜单*/
t = getche();
while (t < '1' || t > '3') { Alarm(); t = getche(); }
if (t == '1') /*选项1:添加选手*/
{
printf("\n\nEnter the number of players [1--%d]:\n",MAX_NUM);
while ( (num = GetInt()) > MAX_NUM || num < 1 )
printf("\nThe number isn't between 1 and %d !\nInput again:\n",MAX_NUM);
AddPlayer(record,num);
flag = 1;
}
if (t == '2') /*选项2:打印名单*/
{
if (flag == 0)
{
system("cls");
printf("\n\aYou haven't added any player !\n");
printf("Press any key to return to Main Menu !\n");
getch();
}
else
PrintList(record,num);
}
} while (t != '3'); /*选项3:退出程序*/
printf("\nPress any key to exit !");
getch();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -