#include<stdio.h>
struct students_jia{ char name[10]; int birthday; char phone[15]; };void sort(struct students_jia s[],int n){ int i,j; struct students_jia temp; for(i=1;i<n;i++) for(j=0;j<n-1;j++) if(s[j].birthday >s[j+1].birthday) { temp=s[j]; s[j]=s[j+1]; s[j+1]=temp; }}int main(){ int i,n;struct students_jia students[3];printf("Enter:n");scanf("%d",&n);for(i=0;i<n;i++)scanf("%s%d%s",students[i].name,&students[i]. birthday,students[i].phone);sort(students,n);for(i=0;i<n;i++)printf("%s\n%d\n%s\n",students[i].name,students[i]. birthday,students[i].phone);return 0;}
#include"stdio.h"
struct student{ int number,record;char name[20],grade;}a[10];char set_grade(int r);int main(){ int i;printf("输入10名学生信息\n学号\t姓名\t成绩\n");for(i=0;i<10;i++){ scanf("%d%s%d",&a[i].number,a[i].name,&a[i].record);a[i].grade=set_grade(a[i].record);}printf("学号\t姓名\t成绩\t等级\n");for(i=0;i<10;i++)printf("%d\t%s\t%d\t%c\n",a[i].number,a[i].name,a[i].record,a[i].grade);printf("不及格者\n");for(i=0;i<10;i++)if(a[i].grade=='D')printf("%d\t%s\t%d\t%c\n",a[i].number,a[i].name,a[i].record,a[i].grade);return 0;}char set_grade(int r){ if(r<=100&&r>=85)return 'A';if(r<=84&&r>=70)return 'B';if(r<=69&&r>=60)return 'C';if(r<=59&&r>=0)return 'D';elsereturn '?';}