希望大神帮助,写一下设计步骤
#define N 10#include "stdio.h"
struct worker
{ int num;
char name[20];
char sex;
char lever;
}wor[N];
static int s,j,k;
void sum(char x)
{
if(x=='A')s++;
if(x=='B')j++;
if(x=='C')k++;
}
void output()
{
int i;
printf("the worker information:\n");
for(i=0;i<N;i++)
printf("%d,%s,%c,%c\n",wor[i].num,wor[i].name,wor[i].sex,wor[i].lever);
} main()
{int i,o;
for(i=0;i<N;i++)
{
o=i+1;
printf("please input the %d worker's num name sex age lever :\n",o);
scanf("%d %s %c %c",&wor[i].num,wor[i].name,&wor[i].sex,&wor[i].lever);
sum(wor[i].lever);
}
output(); printf("A:%d,B:%d,C:%d\n",s,j,k);}有没有帮我解释一下这个设计步骤?急用???谢谢