aaaaaaaaa

#include<stdio.h>
struct student{
    char name[4];
    double age;
 };
 int main(void)
 {
    int i,index,j,n;
    struct student studengts[4],temp;
    
    for(i=0;i<n-1;i++){
        index=i;
        for(j=i+1;j<n;j++)
           if(students[j].age<students[index].age)
             index=j;
        temp=student[index];
        studengs[index]=student[i];
        student[i]=temp;
    }
    printf"num\t name\t age\n";
    for(i=0;i<n;i++)
    printf("%d\t%s\t%.2f\n",student[i].name,student[i]age]);
    
    return 0;
 }

 

posted @ 2013-11-21 09:56  傻子疯子捏子  阅读(717)  评论(0编辑  收藏  举报