填空题:请补充main()函数,该函数的功能是:如果数组arr的前一个元素比后一个元素小,则把它保存在数组bb中并输出。例如,若

  • 题目分类:C语言
  • 题目类型:填空题
  • 号外号外:注册会员即送体验阅读点!
题目内容:
请补充main()函数,该函数的功能是:如果数组arr的前一个元素比后一个元素小,则把它保存在数组bb中并输出。
例如,若数组中的元素为:“40,68,62,33,35,52,48,95,66,73”,则输出:“40,33,35,48,66”。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在main()函数的横线上填人所编写的若干表达式或语句。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#define M 10
void main()
{
int i,n=0:
int arr[M]={40,68,62,33,35,52,48,95,66,73);
int bb[M];
system(”CLS”);
for(i=0;i<【1 ;i++)
if(arr[i]<arr[i+1])
【2
printf(”\n***display bb***\n”);
for(i=0;i<n;i++)
printf("bb[%d]=%2d", 【3 );
}
参考答案:【答案仅供学习,请勿对照自行用药等】
答案解析:

下列给定程序中函数proc的功能是:取出长整型变量s中偶数位上的数,依次构成一个新数放在t中。例如,当s中的数为1234

下列给定程序中函数proc的功能是:取出长整型变量s中偶数位上的数,依次构成一个新数放在t中。例如,当s中的数为123456789时,t中的数为2468。请修改

查看答案

Which arrangement is taking place at the time that was plan

Which arrangement is taking place at the time that was planned?A.the meeting

查看答案

The paragraph following the passage most likely discuss

The paragraph following the passage most likely discussA.unusual ways to advert

查看答案

How large is TVROs' market share?

How large is TVROs' market share?A.about a quarter B.about a half. C.three quart

查看答案