当先后输入1、3、4、12、23时,屏幕上出现 【11】 ;再输入12时,则屏幕上出

题型:填空题

问题:

当先后输入1、3、4、12、23时,屏幕上出现 【11】 ;再输入12时,则屏幕上出现 【12】
#include <stdio.h>
#define N 5
main()
int i,j,number,top,bott,min,loca,a[N],flag;
char c;
printf("Please input 5 numbers (a[i]>a[i-1])\n");
scanf("%d",&a[0]);
i=1;
while (i<N)
scanf("%d",&a[i]);
if (a[i]>=a[i-1)) i++;

printf("\n");
for (i=0;i<N;i++) printf("%d",a[i]);
printf("\n");
flag=1;
while (flag)
scanf("%d",&number);
loca=0;
top=0;
bott=N-1;
if ((number<a[0])||(number>a[N-1])) loca=-1;
while ((loca==0) && (top<=bott))
min=(bott+top)/2;
if (number==a[min])
loca=min;
printf("%d is the %dth number\n",number,loca+1);

else if (number<a[min]) bott=min-1;
else top=min+1;

if (loca==0||loca==-1) printf("%d is not in the list.\n",number);
c=getchar();
if (c==’N’||c==’n’) flag=0;

考点:计算机等级考试C语言二级C语言笔试
题型:填空题

— What's the noise? It sounds as if it comes from upstairs.

— _____. It must be the window-cleaner working, next door. [ ]

A. I'm not sure

B. I hope not

C. I'd rather not

D. I don't think so

题型:填空题

科目编码首位为1代表( )类。

A.资产

B.负债

C.所有者权益

D.成本

题型:填空题

按照我行重点客户管理有关规定,重点客户的信贷投放可不受()限额限制,但需按规定履行限额领用程序或事后报备。

题型:填空题

简述黄连的植物学特征?

题型:填空题

使用氟利昂检漏灯检漏时应注意哪些事项?

更多题库