3下列程序运行结果为()。main(){ int x=0,y=2,z=2;switch(x){ case 0:switch(y==2){ case 1:printf("*");break;case 2:printf("%%");break;}case 1:switch(z){ case 1:printf("$");break;default:printf("!");break;case 2:printf("*");}}}
4a数组中是一组升序的数,现由键盘输入一个待查的整数x,用二分法查找,若x存在输出其所在的位置,否则给出没找到信息。请将程序填充完整。#include <stdio.h>#define N 10void main(){ int i,x,low,high,mid;int a[N]={25,28,37,44,65,76,79,83,85,92};scanf("%d",&n);low=0;high=N-1;scanf("%d",&x);while (low<=high){ mid=(low+high)/2;if(x<a[mid]) high=mid-1;if(x>a[mid]) low=mid+1;if (x==a[mid]) _________;}if(low<=high) printf("found,%d in position %dn",x,mid);else printf("%d no foundn",x);}