C language student information management system code

The code is as follows:

# include & ltstdio.h & gt

# include & ltmalloc.h & gt

# include & ltstdlib.h & gt

# include & ltstring.h & gt

# include & ltconio.h & gt

Typedef structure check//examinee information structure

{? char exampno[20]; //Admission ticket number

Character name [10]; //Name

char sex[4]; //Gender

Young; //age

char exam type[ 10]; //enter oneself for an examination subjects

} ElemType

Typedef structure node//defines a linked list node.

{

Element type data; //Data field

Structure node * next// pointer field

} node, * list, * location;

List make _ empty(List L); //Create an empty table with a leading node.

Int is _ empty (list l); //Test whether the linked list is empty.

Int is _last (position p, list l); //Test whether the current position is a footer.

position make_node( position p,int n); //Create a node and enter the examinee information.

Void put_information (position p); //Output the candidate's information?

Void put_name_information (list l); //Output the candidate information with the name of xx.

Int put_pos_information (position p); //Output candidate information at this address.

Void link_to_tail (list l, position p); //Connect the node to the footer

int ciculation _ make(); //Create candidate information circularly.

int judge _ put _ all(); //Whether to output the information of all candidates?

void put _ all(List L); //Output the information of all candidates.

Location search (list l); //Find the first element named xx and return the position.

Location find_previous (list l); //Find the first element named xx and return the position of its immediate predecessor.

//int judge _ delete _ val(); //Ask whether to delete the candidate data.

int delete _ val(List L); //Delete the information of the specified candidate and output it.

Void menu (list l); //Menu function

List l;

//position p;

Internationalorganizations (same as international organizations)

main( void)?

{

List L = NULL// defines the head node pointer.

Position p = empty; //Define table work pointer

L = make _ empty(L); //Create an empty table

Printf ("\ t \ t \ t ★★★ Candidate Registration Management Procedure ★ \ n \ t \ t-.

Menu (left);

Returns 0;

}

//Create an empty table with a leading node.

catalogue

Make_empty (list l)

{

l =(List)malloc(sizeof(Node));

if(NULL == L)

{

Printf ("Memory allocation failed");

Exit (1);

}

l-& gt; next = NULL

//printf ("The empty table was created successfully. \ n ");

Return l;

}

//Create a node and enter the examinee information.

location

Make_node (position p, integer n)

{

If (n) //n is 1, create and enter a node, and if n is 0, modify the node.

{

P = (location) malloc (sizeof (node));

p->; next = NULL

}

Printf ("Please enter the candidate's admission ticket number:");

Get (p->; data . exam no);

Printf ("Please enter candidate's name:");

Get (p->; data . name);

do

{

Printf ("Please enter the candidate's gender, only" male "or" female ":);

Get (p->; data . sex);

}

And (0! = strcmp(p-& gt; Data.sex, "male")&; & amp0 ! = strcmp(p-& gt; Data.sex, "female"); //Judge whether the gender is wrong.

Printf ("Please enter the age of the applicant:");

scanf("%hd ",& ampp->; data . age);

getchar(); ? //If this sentence is deleted, the following application categories will not be realized.

/* do while below is used to judge whether the application category is entered incorrectly */

do

{

Printf ("Please enter the registration category, which can only be" Mathematics "or" English "or" Data Structure ":);

Get (p->; data . exam type);

}

And (0! = strcmp ("English", p-> data . exam type)& amp; & amp0 ! = strcmp ("mathematics", p-> data . exam type)& amp; & amp0 ! = strcmp ("data structure", p-> data . exam type));

If (n)

{

Printf ("Registration successful \ n");

}

other

{

Printf ("Modification succeeded \ n");

}

Return p;

}

//Pre-insertion method;

empty

Link_to_tail (list l, position p)

{

p->; next = L-& gt; Next;

l-& gt; next = p;

}

//Find the first element named xx and return the position.

location

Find (list l)

{

Position p = L-& gt;; Next;

Character name [10];

Printf ("Please enter the name of the candidate you are looking for:");

Get (name);

And (p! = NULL & amp& amp0 ! = strcmp(p-& gt; data.name,name))

{

p = p-& gt; Next;

}

Return p;

}

//Test whether the linked list is empty.

Internationalorganizations (same as international organizations)

Is_empty (list l)

{

Return to l-> next = = NULL

}

//Test whether the current position is a footer.

Internationalorganizations (same as international organizations)

Is_last (position p, list l)

{

Return to p-> next = = NULL

}

//Output the candidate information with the name of xx.

empty

Upload name information (list l)

{

Position p = find (l);

If (p! = empty)

{

Printf ("candidate information you are looking for: \ n");

Printf ("Admission number:% s \ tName:% s \ tGender:% s \ tGender:% HD \ Subject: %s\n\n", p-> data.examno,p-& gt; data.name,p-& gt; data.sex,p-& gt; data.age,p-& gt; data . exam type);

}

other

{

Printf ("There is no student you are looking for. \ n ");

}

}

//Create candidate information circularly.

Internationalorganizations (same as international organizations)

ciculation_make()

{

int n = 2;

do

{

Printf ("Do you want to continue creating candidate information? Please enter "1" or "0" if not:);

scanf("%d ",& ampn);

getchar();

}

And (n! = 0 & amp& ampn! = 1);

Returns n;

}

//Whether to output candidate information?

empty

Put_information (position p)

{

int n = 2;

do

{

Printf ("Do you want to output the candidate's information? Please enter "1" or "0" if not:);

scanf("%d ",& ampn);

getchar();

}

And (n! = 0 & amp& ampn! = 1);

If (n)

{

Printf ("Admission number:% s \ tName:% s \ tGender:% s \ tSubject:% HD \ Subject: %s\n", p-> data.examno,p-& gt; data.name,p-& gt; data.sex,p-& gt; data.age,p-& gt; data . exam type);

}

}

//Whether to output the information of all candidates?

Internationalorganizations (same as international organizations)

judge_put_all()

{

int n = 2;

do

{

Printf ("Do you want to output the information of all candidates? Please enter "1" or "0" if not:);

scanf("%d ",& ampn);

getchar();

}

And (n! = 0 & amp& ampn! = 1);

Returns n;

}

//Output the information of all candidates.

empty

Put_all (list l)

{

If (l->; next == NULL)

{

Printf ("There are no candidates to register now! \ n ");

}

other

{

Position p = L-& gt;; Next;

And (p! = empty)

{

Printf ("Admission number:% s \ tName:% s \ tGender:% s \ tSubject:% HD \ Subject: %s\n", p-> data.examno,p-& gt; data.name,p-& gt; data.sex,p-& gt; data.age,p-& gt; data . exam type);

p = p-& gt; Next;

}

}

//getchar();

}

//Ask whether to delete the candidate data.

Internationalorganizations (same as international organizations)

Judge delete value ()

{

int n = 2;

do

{

Printf ("Do you want to delete the candidate's data? Yes, please enter "1" instead of "0":);

scanf("%d ",& ampn);

getchar();

}

And (n! = 0 & amp& ampn! = 1);

Returns n;

}

//Find the first element named xx and return the position of its immediate predecessor.

location

Find_previous (list l)

{

Position q = L;;

Position p = L-& gt;; Next;

Character name [10];

Printf ("Please enter the name of the candidate you are looking for:");

Get (name);

And (p! = NULL & amp& amp0 ! = strcmp(p-& gt; data.name,name))

{

q = p;

p = p-& gt; Next;

}

If (p! = empty)

{

Return q;

}

other

Return p;

}

//Delete the information of the specified candidate and output it.

Internationalorganizations (same as international organizations)

Delete values (list l)

{

int n = 2;

Position q = empty;

position p = find _ previous(L); //Returns the information address of the candidate.

if( NULL == p)

{

Printf ("The candidate you want to delete does not exist \ n");

Returns 0;

}

other

{

q = p->; Next;

p->; next = q-& gt; Next;

Printf ("deleted successfully. \ nThe candidate information deleted is: \ n ");

Printf ("Admission number:% s \ tName:% s \ tGender:% s \ tSubject:% HD \ Subject: %s\n", q-> data.examno,q-& gt; data.name,q-& gt; data.sex,q-& gt; data.age,q-& gt; data . exam type);

Free (q);

Returns1;

}

}

//Output the inspection information of this address.

Internationalorganizations (same as international organizations)

Placement position information (position p)

{

If (p! = empty)

{

Printf ("Admission number:% s \ tName:% s \ tGender:% s \ tGender:% HD \ Subject: %s\n\n", p-> data.examno,p-& gt; data.name,p-& gt; data.sex,p-& gt; data.age,p-& gt; data . exam type);

Returns1;

}

other

{

Printf ("There is no student you are looking for." );

Returns 0;

}

}

//Menu function

empty

Menu (list l)

{

printf("\t\t\t? A. Admission of candidates \ n ");

printf("\t\t\t? B. Inquire about candidates' information \ n ");

printf("\t\t\t? C. Modify the candidate information \ n ");

printf("\t\t\t? D. Delete candidate information \ n ");

printf("\t\t\t? E. Information of all candidates \ n ");

printf("\t\t\t? F. program author information \ n ");

printf("\t\t\t? g? Exit the program \ n ");

char n = ' h

And (n! = 'g ')

{

Do what? //Make sure the input is correct.

{

Printf ("Please select functions by alphabetical number:");

n = getchar();

getchar();

putchar(' \ n ');

If (n<a' | | n & gtg')

{

Printf ("Wrong letter number. \ n ");

}

}

while(n & lt; a ' | | n & gtg’);

Switch (n)

{

Case "a":

{

Printf ("Please enter the information of registered candidates: \ n");

Position p = make_node( p,1); //Create a new node

link_to_tail( L,p); //Connect the new node to the table

put _ information(p); ? //Output the candidate's information?

putchar(' \ n ');

}

Break;

Case "b":

{

put _ name _ information(L);

putchar(' \ n ');

}

Break;

Case "c":

{

int n = 0;

Position p = empty;

Printf ("You are modifying. \ n ");

p = find(L);

n = put _ pos _ information(p);

If (n)

{

make_node( p,0);

put _ information(p); ? //Output the candidate's information?

}

putchar(' \ n ');

}

Break;

Case "d":

{

Printf ("You are deleting. \ n ");

delete _ val(L);

putchar(' \ n ');

}

Break;

Case "e":

{

put _ all(L);

putchar(' \ n ');

}

Break;

Case "f":

{

printf("? Modification date version number? Modifier? Modify content \ n ");

printf("-\ n ");

printf("? 20 18.6. 19 v2.0? Chen Baichuan adds the main menu \ n ");

printf("? 20 18.6.23 v3.0? Chen Baichuan? Increase the function of generating files \ n \ n ");

Printf ("version number is v2.0 \ n");

putchar(' \ n ');

}

Break;

Default value:

Break;

}

}

Printf ("Thank you for using it, and wish you a happy life." );

getch();

}

Extended data:

C language is a general computer programming language, which is widely used in the bottom development. The design goal of C language is to provide a programming language that can compile and process low-level memory in a simple way, generate a small amount of machine code and run without any support of running environment.

Although C language provides many low-level processing functions, it still maintains good cross-platform characteristics. C language programs written in standard specifications can be compiled on many computer platforms, even including some embedded processors (single chip microcomputer or MCU) and supercomputers.

In 1980s, in order to avoid the differences in C language grammar used by different developers, the American National Bureau of Standards formulated a complete set of American national standard grammar of C language, called ANSI C, as the original standard of C language. [ 1]? At present, the standard C 1 1 released by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) on February 8, 2000 is the third official standard of C language, and it is also the latest standard of C language, which better supports Chinese character function names and.

C language is a process-oriented computer programming language, which is different from object-oriented programming languages such as C++ and Java.

Its compilers mainly include Clang, GCC, WIN-TC, SUBLIME, MSVC, Turbo C and so on.

References:

Baidu encyclopedia -C language