选择题:●试题四 【说明】 下面程序的功能是:在含有10个元素的数组中查找最大数,及最大数所在位置(即下标

  • 题目分类:软考初级
  • 题目类型:选择题
  • 查看权限:VIP
题目内容:
●试题四

【说明】

下面程序的功能是:在含有10个元素的数组中查找最大数,及最大数所在位置(即下标值),最大数可能不止一个。

例如:若输入

2857848328

则应输出

The max:8

Total:4∥最大数出现次数

The positions:1469

【函数】

#include<stdio.h>

#define M 10

int fun(int*a,int*n,int pos[])

{

int i,k max=-32767;

(1)

for(i=0;i<M;i++)

if( (2) )max=a[i];

for(i=0;i<M;i++)

if( (3) )pos[k++]=i;

*n=k;

return max;

}

main()

{

int a[M],pos[M],i=0,j,n;

printf("Enter 10 number:");

for(i=0;i<M;i++)scanf("%d", (4) );

j=fun( (5) );

printf("The max:%d\n",j);

printf("Total:%d",n);

printf("The position:");

for(i=0;i<n;i++)printf("%4d",pos[i]);

printf("\n");

}




参考答案:

●There are many page replacement algorithms in the page management.Most frequently used al

●There are many page replacement algorithms in the page management.Most frequently used al

查看答案

● 在SNMP 支持的四种操作中, (60) 用于修改对象的值。 (60)A. get B. get-next C. set D. trap

● 在SNMP 支持的四种操作中, (60) 用于修改对象的值。 (60)A. get B. get-next C. set D. trap

查看答案

●试题五 以下是与Visual Basic开发应用有关的5个问题。对每一个问题,请将解答填入答题纸的对应栏

●试题五 以下是与Visual Basic开发应用有关的5个问题。对每一个问题,请将解答填入答题纸的对应栏

查看答案

●By using MP3,a 600M-byte music CD can be (70) to 50M bytes or less.It can be streamed(dow

●By using MP3,a 600M-byte music CD can be (70) to 50M bytes or less.It can be streamed(dow

查看答案

● 要添加一条到达目标 10.41.0.0(子网掩码为 255.255.0.0)的路由,下一跃点地址为10.27.0.1,则键

● 要添加一条到达目标 10.41.0.0(子网掩码为 255.255.0.0)的路由,下一跃点地址为10.27.0.1,则键

查看答案