Simple C language Student performance management system

Source: Internet
Author: User

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/FB/wKiom1WNaM6AWB0FAAKSbDKCtUk322.jpg "title=" Test.png "alt=" Wkiom1wnam6awb0faaksbdkctuk322.jpg "/>

Readme file

5 students, the number of words outside, four physical results.
1, the total score of each person, the average
2, the average score of all students ' subjects,
3. Sort bubbles by total score or select sort
4. Input results, result form
5, subscript method, pointer method

Structure array represents students, students (student number, name, language, mathematics, English, physics, total score, average)
Enter and add scores to the array, waiting for sorting
Output results
Dispersed into functions-file

Main.c

#include <stdio.h>/*main.c *os:debian-linux *compile:gcc *date:2015-06-24 * *  */typedef struct returnvalue array;struct  student{    char  num[20];    char name[20];    int chinese;     int math;    int english;    int physical;     float score;    float average;} stu[5]=    {        {"1101", "Zhang Yi", 0,0,0,0,0,0},         {"1102", "Li er",0,0,0,0,0,0},         {"1103", "Liu San", 0,0,0,0,0,0},        {"1104", "Zhao Si", 0,0,0,0,0,0 },        {"1105", "Money Five",0,0,0,0,0,0}    };     int bs[5]={0,1,2,3,4};&Nbsp;       void mainmenu () {    printf ("Please enter score: \ n") ;} Void inputscore () {    int i;    for (i=0;i<5;i++)   &NBSP;&NBSP;&NBSP;{&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;SCANF ("%d", &stu[i].chinese);  &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;SCANF ("%d", &stu[i].math);       &NBSP;&NBSP;SCANF ("%d", &stu[i].english); &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;SCANF ("%d",& stu[i].physical);             }}void printall ( {    int j;    printf ("School number   name   language   math   English   Physical    total     average \ n ");     for (j=0;j<5;j++)     {                 printf ("%s  %s %4d %4d %4d %4d %4.1f %6.1f \n ",         stu[j].num,         stu[j].name,         stu[j].chinese,        stu[j].math,         stu[j].english,        stu[j].physical,   &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;STU[J].SCORE,&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;STU[J]. average);         printf ("--------------------------------------------\ n ");     }}void sumave () {    int k;     for (k=0;k<5;k++)     {        stu[k].score  = stu[k].chinese+stu[k].math+stu[k].english+stu[k].physical;                 stu[k].average = stu[k].score/4;    }     }void bubblesort () {          int temp=  0; //Intermediate Variable       int l,m;      //bubble method ordering     for (l=0;l<5;l++)       {           for (m=l+1;m<5;m++)          {               if (stu[bs[l]].score  > stu[bs[m]].score)                 {                   temp = bs[l];                   bs[l] = bs[m];                   bs[m] = temp;               }          }       }    }void printallafterbubblesort () {         printf ("After sorting by total: \ n");             int n;    printf ("School number   name   language   Math   English   physics    Total     average \ n ");     for (n=0;n<5;n++)     {                 printf ("%s %s % 4d %4d %4d %4d %4.1f %6.1f \n ",         Stu[bs[n]].num,  &nbSp;     stu[bs[n]].name,        stu[bs[n]]. chinese,        stu[bs[n]].math,         stu[bs[n]].english,        stu[bs[n]].physical,         stu[bs[n]].score,        stu [Bs[n]].average);         printf ("------------------------------------- -------\ n ");    }                             printf ("\ n");} Int main () {MainMenu (); Inputscore (); Sumave (); Printall (); Bubblesort (); Printallafterbubblesort (); return 0;}

The code is very rough, please advise ...

This article is from the "P6xos" blog, make sure to keep this source http://p6xos.blog.51cto.com/6221518/1666091

Simple C language Student performance management system

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.