⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ydh.txt

📁 程序结构参考 在你的程序中应该由这样的几个部分 各个子函数定义部分(如果这部分已经在头函数中可以不写)
💻 TXT
字号:
程序结构参考 

在你的程序中应该由这样的几个部分

1 头函数嵌入

例如:#include "string.h"
#include "float.h"
#include <stdlib.h>
#include "alloc.h"
#include "malloc.h"

2 宏定义部分

例如:

#define OK 1
#define ERROR 0
#define TRUE 1
#define FALSE 0
#define F9 0x43
#define Esc 0x1b
#define Del 0x53
#define Home 0x47
#define End 0x4f

3 数据类型声明部分

例如:typedef int Boolean;
typedef int Status;

typedef int status;

struct xiangmu
{
int num;//项目编号
int score;//该项目得分
}xiangmu;//项目

typedef struct/*栈结构*/
{int stack[maxlen];
int top;
}stackstru;

4 函数声明部分

例如

Status InitStack(Stack *s);
Status DestroyStack(Stack *s);
Status ClearStack(Stack *s);
Boolean StackEmpty(Stack *s);
int StackLength(Stack *s);
Status Push(Stack *s,SElemType e);
PosType NextPos(PosType seat,int di);
Status MazePath(PosType start,PosType end);//迷宫完 

5 各个子函数定义部分(如果这部分已经在头函数中可以不写)

例如:

void sumpaixu()
{
struct sport *S;
S=sum();
sumpaixu1(S);
}


void nsumpaixu1(struct sport *S)
{
int i,j,r[MAX],mark,k;
clrscr();
for(i=1;i<=N;i++)
{
r[i]=S[i].mscore;
}
i=1;mark=1;j=1;
while((j<N)&&(mark>0))//男子团体总分排序
{
mark=0;
for(i=1;i<=N-j;i++)
if(r[i]>r[i+1])
{
mark++;
k=r[i];r[i]=r[i+1];r[i+1]=k;
}
j++;
}
clrscr();
for(j=N;j>0;j--)//输出
{
for(i=1;i<=N;i++)
{
if(r[j]==S[i].mscore)
printf("\n 第 %d 所学校,总分:%d,男子团体总分:%d,女子团体总分:%d",i,S[i].score,S[i].mscore,S[i].wscore);
}
}
gotoxy(30,24);
printf("按任意键继续");
getch();
caidan1();
}//男子团体总分排序 

6 主函数部分

void main()
{
textbackground(BLUE);
textcolor(YELLOW);
welcome();
mainmenu();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -