题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-15 04:50:26

[填空题]用指针法求出数组元素中最大者和最小者。
int max,min;
void max_min_value(array,n)
int array[],n;
【11】 ;
max=min=*array;
for( 【12】 ;p<array+n;p++)
if(*p>max) max=*p;
else if(*p<min)min=*p;

main( )
int i,number[20],*p;
p=number;
printf("输入20个数据:/n");
for(i=0;i<20;i++,p++) scanf("%d",p);
【13】 ;
max_min_value(p,10);
printf("max=%-10dmin=%d/n",max,rain);

更多"用指针法求出数组元素中最大者和最小者。 int max,min; "的相关试题:

[填空题]用指针法求出数组元素中最大者和最小者。
int max,min;
void max_min_value(array,n)
int array[],n;
【11】 ;
max=min=*array;
for( 【12】 ;p<array+n;p++)
if(*p>max) max=*p;
else if(*p<min)min=*p;

main( )
int i,number[20],*p;
p=number;
printf("输入20个数据:/n");
for(i=0;i<20;i++,p++) scanf("%d",p);
【13】 ;
max_min_value(p,10);
printf("max=%-10dmin=%d/n",max,rain);

[填空题]若输入12、3、2、5、7,则以下程序的运行结果为 【7】
int max,min;
void max_min_value( );
main( )
int i,number[5];
printf("输入5个整数;/n");
for(i=0;i<5;i++) scanf("%d",&number[i]);
max min value(number,5);
printf("max=%d,min=%d/n",max,min);
getch( ); void max_min_value(array,n)
int array[],n;
int*p;
max=min=*array;
for(p=array+1;p<array+n;p++)
if(*p>max)max=*p;
else if(*p<min)min=*p;

[填空题]设int max(int,int)表示计算两个整数中的最大值,则执行语句“cout<<max(max(2,3),max(7,8));”的输出结果是()。
[填空题]将8个数输入数组中,找出其中最大数和最小数并输出。
main( )
int i,max,min,a[8];
for(i=0;i<8;i++)
scanf("%d",&a[i]);
max=a[0];
min=a[0];
for(i=1;i<8;i++)
if(a[i]>max)
max=______;
if(a[i]<min)
______;

printf("max=%d,min=%d/n",______);

[简答题][函数2.1说明] 函数void find(int *a, int n, int * max, int * min)的功能是在长度为n的整型数组a中,查找最大元素和最小元素的下标。main( )中给出了调用find函数的一个实例。 [函数2.1] #include<stdio.h> void find(int *a, int n,int *max,int * min) { int i; *max =* min=0; for(i=1;i<n;i+ +) if(a[i]>a[* max]) (1) ; else if(a[i]<a[*min]) (2) ; return; main( ) { int a[]={4,6,8,9,0,6},max,min; find(a,6, (3) ); printf("%5d%5d/n", max,min); } [函数2.2说明] 以下程序用来对从键盘上输入的两个字符串进行比较,然后输出两个字符串前端的公共部分。例如:输入的两个字符串分别是abcdefg和abceef,则输出为abc。 [函数2.2] #include <stdio.h> main( ) { char str1[100],str2[100],str[100],c; int i=0,s; printf("/nInput string 1:");gets(str1); printf("/nInput string 2:");gets(str2); while(( (4) )&&(str1[i]!=’/0’)&&(str2[i]!=’/0’)){ (5) ; i++; } printf("%s/n",str); }
[简答题][函数2.1说明]
函数void find(int *a, int n, int * max, int * min)的功能是在长度为n的整型数组a中,查找最大元素和最小元素的下标。main( )中给出了调用find函数的一个实例。
[函数2.1]
#include<stdio.h>
void find(int *a, int n,int *max,int * min)
int i;
*max =* min=0;
for(i=1;i<n;i+ +)
if(a[i]>a[* max]) (1) ;
else if(a[i]<a[*min]) (2) ;
return;
main( )
int a[]=4,6,8,9,0,6,max,min;
find(a,6, (3) );
printf("%5d%5d/n", max,min);[函数2.2说明]
以下程序用来对从键盘上输入的两个字符串进行比较,然后输出两个字符串前端的公共部分。例如:输入的两个字符串分别是abcdefg和abceef,则输出为abc。
[函数2.2]
#include <stdio.h>
main( )
char str1[100],str2[100],str[100],c;
int i=0,s;
printf("/nInput string 1:");gets(str1);
printf("/nInput string 2:");gets(str2);
while(( (4) )&&(str1[i]!=’/0’)&&(str2[i]!=’/0’))
(5) ;
i++;

printf("%s/n",str);

[单项选择]下列程序的输出结果是
# include < iostream.h>
int min( int a,int b)

if(a < b)return a;
else return b;
return 0

void main ( )

cout << min(1,min(2,3)) << endl;

A. 0
B. 1
C. 2
D. 3
[单项选择]下列程序的输出结果是
#include<iostream. h>
int min(int a, int b)

if(a<b) retum a;
else return b;
return 0;

void main( )

cout < < min(1,min(2,3) ) < < endl;

A) 0 B) 1 C) 2 D) 3
[单项选择]下列程序的输出结果是
#include<iostream.h>
int min(int a,int b)

if(a<b) return a;
else return b;
return0;

void main( )

cout<<min (1,min (2,3))<<end1;


A. 0
B. 1
C. 2
D. 3
[简答题]编写函数int fun(int lim, int aa[MAX]),该函数的功能是求出小于或等于lim的所有素数并放在aa数组中,该函数返回所求出的素数的个数。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
#include<conio.h>
#include<stdio.h>
#define MAX 100
int fun(int lim, int se[MAX])

main( )

int limit,i,sum;
int aa[MAX];
clrscr( );
printf("输入一个整数");
scanf("%d",&limit);
sum=fun(limit,aa);
for(i=0;i<sum;i++)

if(i%10==0&&i!=0) /*每行输出10个数*/
printf("/n");
printf("%5d ",aa[i]);


[填空题]下列程序的输出结果为 【10】
#inelude<iostream. h>
int &max(int &x, int &y)
return (x>y x: y);
void main( )
int n=3, m=12;
max(m, n)++
cout<<"m="<<m<<", n= "<<n<<end1;

[填空题]下面程序的输出结果是 【15】 。 #define MAX 3 int a[MAX]; main( ) {fun1( );{un2(A) ;printf("/n");} funl( ) { int k,t=0; for(k=0;k<MAX;k++,t++)a[k]=t+t; } fun2(int b[]) { int k; for(k=0;k<MAX;k++)printf("%d",*(b+k)); }
[填空题]下面程序的输出结果是 【15】
#define MAX 3
int a[MAX];
main( )
fun1( );un2(A) ;printf("/n");
funl( )
int k,t=0;
for(k=0;k<MAX;k++,t++)a[k]=t+t;

fun2(int b[])
int k;
for(k=0;k<MAX;k++)printf("%d",*(b+k));

[填空题]下面程序的输出结果是 【7】
#define MAX 3
int a[MAX];
main ( )
fun1( );fun2(a);printf("/n");
fun1( )
int k,t=0;
for (k=0;k<MAX;k++,t++) a[k]=t+t;fun2(int b[])
int k;
for (k=0;k<MAX;k++) printf("%d",*(b+k));

[单项选择]Max Weber was one of the most important German intellectuals of his day. He believed that sociological explanations must derive from an understanding of why people choose the actions they do. This belief differed sharply from Durkheim’s view that society and individuals should be studied at different levels. Weber acknowledged that there are social facts that must be analyzed using scientific methods, but he argued that social facts are the total result of individual actions.
The stress on individual action led Weber to look beyond objective behavior and to focus on people’s subjective beliefs, attitudes, values, and motives. According to Weber, sociologists must interpret, not just observe. They must try to see actions from the point of view of the actor. This approach he called verstehen, which in German means emphatic understanding. Weber stressed that verstehen could be systematic. It did not reduce sociological knowledge simply to matter of opinion. But explanations, in his v

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码