| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 514 人关注过本帖
标题:写了一个学生成绩管理系统
取消只看楼主 加入收藏
夜色的温柔
Rank: 1
来 自:山东青岛
等 级:新手上路
帖 子:21
专家分:0
注 册:2014-9-28
结帖率:25%
收藏
 问题点数:0 回复次数:0 
写了一个学生成绩管理系统
#include<stdio.h>
#include<string.h>
#include<ctype.h>
void main()
{
    void welcome();
    void mulu();
    void xianshikemu();
    void jiaoyan(char a[7],char b[7]);
    int paixu(int e[10]);
    void fenli();
    void xuanzekemu();
    int in(int e[10]);
    int out(int e[10]);
    char denglu(char a[7],char b[7]);
    void input(float *p,int n);
    void display(float *p,int n);
    char a[7],b[7];
    int d;
    denglu(a,b);
    jiaoyan(a,b);
    fenli();
    mulu();
    scanf("%d",&d);
    switch(d)
    {case 1:{
            xianshikemu();
            xuanzekemu();
            }
    case 2:    {
            int e[10];
            int i;
            in(e);
            paixu(e);
            fenli();
            out(e);
            fenli();
            }
    case 3:{
            float score[5];
            input(score,5);
            fenli;
            display(score,5);
           }
    }
}
void welcome()
{
    printf("\n");
    printf("\n");
    printf("\n");
    printf("++++++++++++++++++++++++++++++++++++++++++++++\n");
    printf("+                 欢迎登录                   +\n");
    printf("++++++++++++++++++++++++++++++++++++++++++++++\n");
}
void mulu()
{
    printf("输入1、2、3选择功能\n");
    printf("++++++++++++++++++++++++++++++++++++++++++++++\n");
    printf("+               1:选择科目                  +\n");
    printf("+               2:排序                       +\n");
    printf("+               3:输入成绩                   +\n");
    printf("++++++++++++++++++++++++++++++++++++++++++++++\n");
}
void xianshikemu()
{
        printf("请输入数字1、2、3、4、5选择科目\n");
        printf("++++++++++++++++++++++++++++++++++++++++++++++\n");
        printf("+                 1:语文                    +\n");
        printf("+                 2:数学                    +\n");
        printf("+                 3:英语                    +\n");
        printf("+                 4:体育                    +\n");
        printf("+                 5:物理                    +\n");
        printf("++++++++++++++++++++++++++++++++++++++++++++++\n");
}
int paixu(int e[10])
{
    int i,j;
    int noswap,temp;
    for(i=0;i<10;i++)
        {
            noswap=1;
            for(j=9;j>i;j--)
            {if(e[j]<e[j-1])
                {
                    temp=e[j-1];
                    e[j-1]=e[j];
                    e[j]=temp;
                    noswap=0;
                }
            }
            if(noswap==1)
                    break;
        }
    return e[10];
}
void jiaoyan(char a[7],char b[7])
{
    char Z[]="wsdsb",M[]="sbjsw";
    if(strcmp(a,Z)==0)
    {
        if(strcmp(b,M)==0)
        {
            welcome();
        }
    }
    else
    {
        printf("\n");
        printf("\n");
        printf("输入错误\n");
    }
}
void fenli()
{
    printf("\n");
    printf("\n");
    printf("\n");
    printf("\n");
}
char denglu(char a[7],char b[7])
{
    printf("**********************************************\n");
    printf("              学生成绩管理系统                \n");
    printf("              1:账户:");
    gets(a);
    printf("              2.密码:");
    gets(b);
    printf("**********************************************\n");
    return a[7];
    return b[7];
}
void xuanzekemu()
{
    int c;
    scanf("%d",&c);
    switch(c)
    {
    case 1:printf("您选择1:语文\n");break;
    case 2:printf("您选择2:数学\n");break;
    case 3:printf("您选择3:英语\n");break;
    case 4:printf("您选择4:体育\n");break;
    case 5:printf("您选择5:物理\n");break;
    default:printf("输入错误");
    }
}
int in(int e[10])
{
    int i;
    printf("请输入要排序的十个数字\n");
    for(i=0;i<10;i++)
            scanf("%d",&e[i]);
    return e[i];
}
int out(int e[10])
{
    int i;
    printf("该十个数字由小到大的顺序为:\n");
    for(i=0;i<10;i++)
    {if(i!=9)
        printf("%d<",e[i]);
    else
        printf("%d",e[i]);
    }
    return e[i];
}
void input(float *p,int n)
{
    int i=0;
    float s;
    while(i<n)
    {
        printf("输入第%d个学生的成绩:",i+1);
        scanf("%f",&s);
        if((s>=0)&&(s<=100))
        {
            *(p+i)=s;
            i++;
        }
        else
        {
            printf("输入错误!\n");
            break;
        }

    }
}
void display(float *p,int n)
{
    int i;
    for(i=0;i<n;i++)
        printf("第%d个学生的成绩是:%f\n",i+1,*(p+i));
}







我想实现让第一个功能实现后出现一个选择项:退出和选择功能(返回到原先的选择界面,选择其他功能),我该如何实现,会用到指针、结构体、共用体、文件吗?(这些不太懂)
搜索更多相关主题的帖子: welcome 管理系统 display include 
2015-05-12 16:53
快速回复:写了一个学生成绩管理系统
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017921 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved