| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 417 人关注过本帖
标题:大家看看我的成绩管理。怎么就不行了呢?怎么了呢?
只看楼主 加入收藏
rankun203
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-11-29
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
大家看看我的成绩管理。怎么就不行了呢?怎么了呢?
        不能查询每个学生的数据了啊。看不出来。。。。。。脑子想大了。。
这个文件:http://www.
代码:
#include <stdio.h>
#define C 40                                                                    //set line length
#define N 5                                                                        //set count of student
char name[N][10];
float mark[N][3];
char loading();
char line();
int input();
int search();
//----------------------------------------------------------------------------------
main()
{
    int r;                                                                        //o is choose of user,"r to recycle"
    int o;
    for(r=1;r<100;r++)
  { system("cls");
    printf(" Main Menu\n");
    line(C);                                                                    /*output '*'*/
    printf("* 1.  input data\n* 2.  search score\n* 3.  exit\n");                /* show interface*/
    line(C);                                                                    /*output '*'*/
    printf("please choose:  ");
    scanf("%d",&o);                                                            
    switch(o)                                                                    /*redirection*/
     {
        case 1:input(); break;
        case 2:search(); break;
        case 3:exit(1); break;
        default: {printf("\n Not a option,Please choose again.");getch();} break;
     }
  }   
    return 0;
}
//---------------------------------------------------------------------------------
char loading()
{
      int i,r;
      printf("\n\n     ");
      for(i=1;i<29;i++)
            {
               system("cls");                                                        //may i choose "clrscr"
            printf("\n\n searching");
            sleep(5);
            for(r=30-i;r<30;r++)
                     printf(".");
                                                                                //printf("@^_^@");
            }
      return 0;
}
//----------------------------------------------------------------------------------
char line(int n)                                                                /*define '*' */
{
    int i;
    for(i=1;i<=n;i++)
        printf("*");
    printf("\n");
    return 0;
}
//-----------------------------------------------------------------------------------
int input()
{
    int i,x;
    system("cls");
    printf(" Input Data(Total: %d)\n",N);
    for(i=0;i<N;i++)
    {
        line(C);                                                                /*output '*'*/
        printf("No.%d \n name: ",i+1);
        scanf("%s",name[i]);
        for(x=0;x<3;x++)
          {    printf("\n score of %d: ",x);
            scanf("%f",mark[i]);
          }
        printf("\n");
    }
    line(C);
    getch();
    return 0;   
}
//----------------------------------------------------------------------------------
int search()
{
    char sname[10];
    int i,g;
    system("cls");
    printf(" Search System\n");
    line(C);                                                                    /*output '*'*/
    printf("Please input Name: ");                                
    scanf("%s",sname);
    for(g=0;g<N;g++)
        if(strcmp(sname,name[g])==0)
            break;
    if(g<N)
    {
            loading();
            system("cls");
            printf("\n Result of Search\n");
            line(C);                                                            /*output '*'*/
            {printf("Name: %s\n",name[g]);
                printf("Score: %s\n",mark[g]);}
    }
    else
    {
            printf("There is NO result of Name: %s",sname);
    }

    getch();
    return 0;
}
搜索更多相关主题的帖子: loading include search count 
2011-11-30 07:31
pinglideyu
Rank: 3Rank: 3
来 自:武汉工程大学
等 级:论坛游侠
威 望:1
帖 子:735
专家分:140
注 册:2007-1-7
收藏
得分:10 
没有注释,我不理解你的意思。还有,line()函数是有返回值的,你看下自己的主函数

~~我的明天我知道~~
2011-11-30 11:51
wang155423
Rank: 6Rank: 6
等 级:侠之大者
帖 子:216
专家分:408
注 册:2011-9-4
收藏
得分:10 
不懂啊
2011-11-30 12:50
快速回复:大家看看我的成绩管理。怎么就不行了呢?怎么了呢?
数据加载中...
 
   



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

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