皮皮学,免费搜题
登录
搜题
【简答题】
有长度为10的一维整型数组a,由键盘输入它的值(10个不等的数),求a数组中最小元素的值及其在数组中的位置。输入样例: 16 9 56 23 24 75 6 81 36 35输出样例: 最小元素是 6,是第7个元素注意:a[0]是数组中的第1个元素。请完善程序。(有2个空,答案一行写一个,不要添加多余的空格)#include int main(){int i,a[10],min,k; // k存储位置for(i=0;i<10;i++) scanf("%d",&a[i]); min=a[0];// 假设第1个数为最小数k=1; // k保存最小数的位置,此时为1for(i=1;i<10;i++){ if(a[i] ) { min=a[i];// min更新为较小数 // k更新为较小数的位置 }}printf("最小元素是 %d,是第%d个元素",min,k);}提示:求数组元素的最小值可以参考本附加例题解析“求最值及其位置”中的数组方法例题,注意位置序号与本例的区别
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【判断题】It is improper to ask a caller to identify himself before answering his questions.
A.
正确
B.
错误
【单选题】It is improper to _____ between pupils according to their family background.
A.
different
B.
differentiate
【单选题】When making an inquiry, it is improper to include in your letter____.
A.
the way of payment for the goods
B.
the bargaining over the prices
C.
the product name
D.
the packing of the goods
【判断题】It is improper to ask the interviewer what the time frame is for deciding who will progress to the next stage.
A.
正确
B.
错误
【单选题】图片与图书对婴幼儿语言发展的产生作用,有利于脑的发育、成熟,图片与图书是( )的最佳刺激物,是发展大脑神经组织的最好方式
A.
眼睛
B.
大脑
C.
视觉
D.
耳朵
【简答题】1934年美国克莱斯勒的 牌汽车,首次采用流线形车身。
【判断题】It is improper to use the word “Englishes” under any situation.
A.
正确
B.
错误
【简答题】It is improper to ___ (different) between pupils according to their family background.
【单选题】通常在年终决算前,要
A.
对企业所有财产进行技术推算盘点
B.
对企业所有财产进行全面清查
C.
对企业一部分财产进行局部清查
D.
对企业流动性大的财产进行全面清查
【单选题】It is improper to _______ others while they are talking.
A.
interview
B.
interrupt
C.
influence
D.
interact
相关题目: