计算机等级考试(三级)上级资料.docVIP

  • 1
  • 0
  • 约2.28万字
  • 约 35页
  • 2017-12-22 发布于河南
  • 举报
计算机等级考试(三级)上级资料

计算机等级考试(三级)上级资料 按结构体成员筛选并排序 void SortDat() { int i,j; /* 定义变量 */ PRO temp; for(i=0;iMAX-1;i++) /* 选择法排序 */ for(j=i+1;jMAX;j++) if(strcmp(sell[i].mc,sell[j].mc)0 /* 判断条件 */ ||strcmp(sell[i].mc,sell[j].mc)==0sell[i].jesell[j].je) { temp=sell[i]; sell[i]=sell[j]; sell[j]=temp; } } 数位分解后按数筛选统计并排序 void jsValue() { int i,j; /* 定义变量 */ int a1,a2,a3,a4; int temp; for(i=0;i300;i++) { a1=a[i]%10; /* 数位分解 */ a2=a[i]%100/10; a3=a[i]%1000/100; a4=a[i]/1000; if(a4+a1==a3+a2) /* 判断条件 */ b[cnt++]=a[i]; } for(i=0;icnt-1;i++) /* 选择法排序 */ for(j=i+1;jcnt;j++) if(b[i]b[j]) { temp=b[i]; b[i]=b[j]; b[j]=temp; } } void jsVal() { int i,j; /* 定义变量 */ int a1,a2,a3,a4; int temp; for(i=0;iMAX;i++) { a1=a[i]%10; /* 数位分解 */ a2=a[i]%100/10; a3=a[i]%1000/100; a4=a[i]/1000; if(a1%2==1a2%2==1a3%2==1a4%2==1) /* 判断条件 */ b[cnt++]=a[i]; } for(i=0;icnt-1;i++) /* 选择法排序 */ for(j=i+1;jcnt;j++) if(b[i]b[j]) { temp=b[i]; b[i]=b[j]; b[j]=temp; } } void jsVal() { int i,j; /* 定义变量 */ int temp; for(i=0;iMAX;i++) if(a[i]%2==1b[i]%2==0||a[i]%2==0b[i]%2==1) /* 判断条件 */ c[cnt++]=(a[i]8)+b[i]; for(i=0;icnt-1;i++) /* 选择法排序 */ for(j=i+1;jcnt;j++) if(c[i]c[j]) { temp=c[i]; c[i]=c[j]; c[j]=temp; } } void countValue() { int i,j; /* 定义变量 */ int a1,a2,a3,a4; for(i=1000;i=9999;i++) { a1=i%10; /* 数位分解 */ a2=i%100/10

文档评论(0)

1亿VIP精品文档

相关文档