33、给定程序中,函数fun的功能是:调用随机函数产生20个互不相同的整数放在形参a所指数组中(此数组在主函数中已置0)。
请在程序的下划线处填入正确的内容并把下划线删除, 使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
#include #include #define N 20
void fun( int *a)
{ int i, x, n=0;
x=rand() ;
/**********found**********/
while (n<__1__)
{ for(i=0; i if( x==a[i] ) __2__;
/**********found**********/
if( i==__3__){ a[n]=x; n++; }
x=rand() ;
}
}
main()
{ int x[N]={0} ,i;
fun( x );
printf("The result : \n");
for( i=0; i if((i+1)%5==0)printf("\n");
}
printf("\n\n");
}
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|