当前位置:网站首页>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;
}
}
边栏推荐
- Codeforces Round #802 (Div. 2)
- Kept to implement redis autofailover (redisha) 1
- 无需人工先验!港大&同济&LunarAI&旷视提出基于语义分组的自监督视觉表征学习,显著提升目标检测、实例分割和语义分割任务!...
- 【207】Apache崩溃的几个很可能的原因,apache崩溃几个
- 1-12Vmware新增SSH功能
- What does the inner structure of the neural network "alchemy furnace" look like? An interpretation of the thesis by the doctor of Oxford University
- 知道这几个命令让你掌握Shell自带工具
- TCP congestion control details | 1 summary
- Kubecon China 2021 Alibaba cloud special session is coming! These first day highlights should not be missed
- Notes on key review of software engineering at the end of the term
猜你喜欢

Arduino uno + DS1302 simple time acquisition and serial port printing

Net based on girdview control to delete and edit row data

Interpretation of cloud native microservice technology trend

The first open source MySQL HTAP database in China will be released soon, and the three highlights will be notified in advance

了解下常见的函数式接口

架构实战营毕业设计

建立自己的网站(16)

我把它当副业月入3万多,新手月入过万的干货分享!

Arduino UNO + DS1302简单获取时间并串口打印

Pybullet robot simulation environment construction 5 Robot pose visualization
随机推荐
Supplement the short board - Open Source im project openim about initialization / login / friend interface document introduction
Binary array command of redis
Constructors and Destructors
精致妆容成露营“软实力”,唯品会户外美妆护肤产品销量激增
Notes on key review of software engineering at the end of the term
Redis migration (recommended operation process)
day10每日3题(1):逐步求和得到正数的最小值
Make up the weakness - Open Source im project openim about initialization / login / friend interface document introduction
Knowing these commands allows you to master shell's own tools
What is flush software? Is it safe to open an account online?
No manual prior is required! HKU & Tongji & lunarai & Kuangshi proposed self supervised visual representation learning based on semantic grouping, which significantly improved the tasks of target dete
num[i]++
最小二乘系统辨识课 中篇:递归最小二乘
Redis Guide (8): principle and implementation of Qianfan Jingfa distributed lock
构造函数和析构函数
Use the array to calculate the average of N numbers, and output the numbers greater than the average
Arduino uno + DS1302 simple time acquisition and serial port printing
C语言 头哥习题答案截图
# 补齐短板-开源IM项目OpenIM关于初始化/登录/好友接口文档介绍
How to implement interface current limiting?