当前位置:网站首页>Call the random function to generate 20 different integers and put them in the index group of institute a
Call the random function to generate 20 different integers and put them in the index group of institute a
2022-06-26 16:44:00 【Muzi..】
#include<stdio.h>
#include<stdlib.h>
#define N 20
void fun(int *a);
int main()
{
int x[N],i;
fun(x);
printf("the result:\n");
for(i=0;i<N;i++)
{
printf("%4d",x[i]);
if((i+1)%5==0)
printf("\n");
}
}
void fun(int *a)
{
int x,i,n=0;
x=rand()%20;
while(n<20)
{
for(i=0;i<n;i++)
if(x==a[i])
{
break;
}
if(i==n)
{
a[n]=x;n++;
}
x=rand()%20;
}
}
边栏推荐
- Redis Guide (8): principle and implementation of Qianfan Jingfa distributed lock
- Scala Basics (II): variables and data types
- proxy
- day10每日3题(2):统计最大组的数目
- 【207】Apache崩溃的几个很可能的原因,apache崩溃几个
- Research on natural transition dubbing processing scheme based on MATLAB
- Constructors and Destructors
- Toupper function
- 长安链交易防重之布谷鸟过滤器
- 对话长安马自达高层,全新产品将在Q4发布,空间与智能领跑日系
猜你喜欢

架构实战营毕业设计

C language --- basic function realization of push box 01

探讨:下一代稳定币
![[Li Kou brush questions] 11 Container holding the most water //42 Rain water connection](/img/45/1e712300ea655856762394fba09066.png)
[Li Kou brush questions] 11 Container holding the most water //42 Rain water connection
Redis Guide (8): principle and implementation of Qianfan Jingfa distributed lock
![[force deduction question] two point search: 4 Find the median of two positive arrays](/img/4f/43aa7e14344e7e1a2fb7c1d209d13b.png)
[force deduction question] two point search: 4 Find the median of two positive arrays

1-12Vmware新增SSH功能

How to implement interface current limiting?

Niuke Xiaobai monthly race 50

【毕业季】致毕业生的一句话:天高任鸟飞,海阔凭鱼跃
随机推荐
对话长安马自达高层,全新产品将在Q4发布,空间与智能领跑日系
"C language" question set of ⑩
Redis 概述整理
基于Kubebuilder开发Operator(入门使用)
C语言 头哥习题答案截图
JS教程之Electron.js设计强大的多平台桌面应用程序的好工具
Kept to implement redis autofailover (redisha)
Kept to implement redis autofailover (redisha) 1
长安链交易防重之布谷鸟过滤器
网页课程设计大作业——华山旅游网
【力扣刷题】二分查找:4. 寻找两个正序数组的中位数
数据分析----numpy快速入门
Solution for filtering by special string of microservice
Some instance methods of mono
Knowing these commands allows you to master shell's own tools
Acid of redis
1-12vmware adds SSH function
LeetCode Algorithm 24. 两两交换链表中的节点
Dialogue with the senior management of Chang'an Mazda, new products will be released in Q4, and space and intelligence will lead the Japanese system
What does the inner structure of the neural network "alchemy furnace" look like? An interpretation of the thesis by the doctor of Oxford University