| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3486 人关注过本帖
标题:求大神给我看下.什么地方不对啊!我就是找不到啊!
只看楼主 加入收藏
AQ2130062
Rank: 1
来 自:浙江宁波
等 级:新手上路
帖 子:5
专家分:0
注 册:2016-5-9
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
求大神给我看下.什么地方不对啊!我就是找不到啊!
score *creatlink()
{
    score*head;
    score *pl,*p2,*p3,*max;
    int i,j;
    float fen;
    char t[10];
    n=0;
    p1=p2=p3=(score *)malloc(LEN);head=p3;
    printf("请输入学生资料, 输0退出!\n");
repeat1: printf("请输入学生学号(学号应大于0): ");
         scanf("%d",@p1->number);
         while(p1->number<0)
         {
             getchar();
             printf("输入错误,新重新输入学生学号:");
                 scanf("%d",@p1->number):}
         if(p1->number==0)
             goto end;
         else
         {
             p3=head;
             if(n>0)
             {for(i=0;i<n;i++)
             {if(p1->number!=p3->number)
             p3=p3->next;
             else
             {printf("学号重复,请重输!\n");
             goto repeat1;
             }
             }
             }
         }
         printf("请输入学生姓名: ");
             scanf("%s",@p1->name);
             printf("请输入语文成绩(0~100): ");
             scanf("%f",@p1->chinese);
             while(p1->chinese<0||p1->chinese>100)
             {
                 gerchar();
                 printf("输入错误, 请重新输入语文成绩");
                 scanf("%f",@p1->chinese);}
             printf("请输入数学成绩(0~100): ");
             scanf("%f",@p1->mathmatic);
             while(p1->mathmatic<0||p1->mathmatic>100)
             {
                 getchar();
                 printf("输入错误, 请重新输入数学成绩");
                 scanf("%f",@p1->mathmatic);}
             printf("请输入英语成绩(0~100): ");
             scanf("%f",@p1->english);
             while(p1->english<0||p1->english>100)
             {
                 getchar();
                 printf("输入错误, 请重新输入英语成绩");
                 scanf("%f",@p1->english);}
             head=NULL;
             while(p1->number!=0)
             {
                 n=n+1;
                 if(n==1)
                     head=p1;
                 else
                     p2->next=p1;
                 p2=p1;
                 p1=(score *)malloc(LEN);
                     printf("请输入学生资料, 输0退出!\n");
repeat2:printf("请输入学生学号(学号应大于0): ");
        scanf("%d",@p1->number);
        while(p1->number<0)
        {
            getchar();
            printf("输入错误,请重新输入学生学号:");
            scanf("%d",@p1->number);}
        if(p1->number==0)
            goto end;
        else
        {
            p3=head;
            if(n>0)
            {for(i=0;i<n;i++)
            {if(p1->number!=p3->number)
            p3=p3->next;
            else
            {
                printf("学号重复,请重输!\n");
                goto repeat2;
            }
            }
            }
        }
        printf("请输入学生姓名: ");
        scanf("%s",@p1->name);
        printf("请输入语文成绩(0~100): ");
        scanf("%f",@p1->chinese);
        while(p1->chinese<0||p1->chinese>100)
        {
        getchar();
            printf("输入错误, 请重新输入语文成绩");
            scanf("%f",@p1->chinese);}
            printf("请输入数学成绩(0~100): ");
            scanf("%f",@p1->mathmatic);
            while(p1->mathmatic<0||p1->mathmatic>100)
            {
                getchar();
                printf("输入错误, 请重新输入数学成绩");
                scanf("%f",@p1->mathmatic);}
                printf("请输入英语成绩(0~100): ");
                scanf("%f",@p1->english);
                while(p1->english<0||p1->english>100)
                {getchar();
                printf("输入错误, 请重新输入英语成绩");
        scanf("%f",@p1->english);}
             }
end: p1=head;
     p3=p1;
     for(i=1;i<n;i++)
     {
         for(j=i+1;j<=n;j++)
         {
             max=p1;
             p1=p1->next;
             if(max->number>p1->number)
                 {
                 k=max->number;
                 max->number=p1->number;
                 p1->number=k;
                 strcpy(t,max->name);
                 strcpy(max->name,p1->name);
                 strcpy(p1->name,t);
                 fen=max->chinese;
                 max->chinese=p1->chinese;
                 p1->chinese=fen;
                 fen=max->mathmatic;
                 max->mathmatic=p1->mathmatic;
                 p1->mathmatic=fen;
                 fen=max->english;
                 max->english=p1->english;
                 p1->english=fen;
             }
         }
         max=head;p1=head;
     }
     p2->next=NULL;
     printf("输入的学生数为:%d个!\n",n);
     return(head);
     }
搜索更多相关主题的帖子: number 资料 
2016-05-09 21:51
AQ2130062
Rank: 1
来 自:浙江宁波
等 级:新手上路
帖 子:5
专家分:0
注 册:2016-5-9
收藏
得分:0 
有人知道吗?帮忙解决下!!

我真的很帅
2016-05-09 22:18
wengbin
Rank: 10Rank: 10Rank: 10
来 自:陕西西安
等 级:贵宾
威 望:19
帖 子:370
专家分:1846
注 册:2015-5-8
收藏
得分:14 
先把你编码中所有的@改成&再说吧....什么编译器边这样的错都不报?
2016-05-10 14:52
快速回复:求大神给我看下.什么地方不对啊!我就是找不到啊!
数据加载中...
 
   



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

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