摘要: #include<stdio.h>int main(){ struct student { int num; char name[20]; float score; }student1,student2; scanf("%d%s%f",&student1.num,student1.name,&student1.score); scanf("%d%s%f",&student2.num,student2.name,&student2.score); if(student1.score>student2.sco 阅读全文
posted @ 2012-05-30 14:59 尔滨之夏 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int a[15]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; int i,n,low,high,mid,flag; while(scanf("%d",&n)!=EOF) { flag=-1; low=0; high=14; while(low<high) { mid=(low+high)/2; if(n>a[mid]) low=mid+1; else if(n<a[mid]) high=mid; else { flag=mid; break; 阅读全文
posted @ 2012-05-30 14:57 尔滨之夏 阅读(193) 评论(0) 推荐(0) 编辑