zoukankan      html  css  js  c++  java
  • 第一题

    #include<stdio.h>
    struct student{
        int num;
        char name[10];
        int score;
    
    };
    int main(void)
    {
        int sum;
        double average;
        int i,index,j;
        struct student students[10],temp;
    
        for(i=0;i<10;i++)
        {
            scanf("%d",&students[i].num);
            scanf("%s",students[i].name);
            scanf("%d",&students[i].score);
        }
        for(i=1;i<=10;i++)
        {
            sum=sum+students[i].score;
            average=sum/10;
        }
    
            for(i=0;i<10-1;i++)
            {
                index=i;
                for(j=i+1;j<10;j++)
                    if(students[j].score>students[index].score)
                        index=j;
                    temp=students[index];
                    students[index]=students[i];
                    students[i]=temp;
            }
            printf("num name average
    ");
    
            for(i=0;i<10;i++)
                printf("The student score:
    ");
            scanf("%d %s %.2lf
    ",students[i].num,students[i].name,students[i].score);
            
       
        return 0;
    }
  • 相关阅读:
    常见的arp欺骗
    ARP欺骗分析
    周总结
    周总结
    周总结
    win10下 修改host文件 新添域名不生效
    周总结
    周总结
    周总结
    周总结
  • 原文地址:https://www.cnblogs.com/jiangjiali/p/3435344.html
Copyright © 2011-2022 走看看