linux rand application
2024-08-21 13:15:33
code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h> #define random_1(a, b) ((rand()%(b - a)) + a)
#define random_2(a, b) ((rand()%(b - a + 1)) + a) int main(int argc, char **argv)
{
srand((int)time(NULL));
int arr[];
for(int i = ; i < ; i++){
arr[i] = random_1(, );
} for(int i = ; i < ; i++){
printf("%d\t", arr[i]);
} return ;
}
https://www.cnblogs.com/tonyc/p/7732119.html
最新文章
- js中replace的回调函数使用。
- 大学回顾和C与PHP之路
- select,poll,epoll的归纳总结区分
- C# Socket 入门3 UPD(转)
- 整理:Google jQuery 引用地址大全和方法(转)
- apache2.4配置虚拟目录
- cache 的设计与实现--转载
- 帮助中心 7D-我的私家设计师 设计师品牌服饰集成网 7D服装定制!
- fullcalendar日历控件知识点集合
- HTML解析原理概括(转载)
- Spring MVC 基础笔记
- C++学习-6
- 内存数据网格IMDG简介
- linux系统执行mysql脚本:Can&#39;t connect to local MySQL server through socket &#39;/tmp/mysql.sock&#39;
- [转]Java反射机制详解
- PHP之PSR
- (转帖)CentOS最常用命令及快捷键整理
- IntelliJ IDEA2018激活方法
- NGINX宏观手记(变量|配置)
- CSS :hover 选择器
热门文章
- RabbitMQ实战
- ActiveMQ Queue vs Topic vs VirtualTopic
- 结合模板导出PDF文件
- CentOS7搭建git服务器
- WEB安全工程师整理资料
- STM32+IAR 解决Error[Pe147]: declaration is incompatible with ";__nounwind __interwork __softfp unsigned
- ssh本机失败(ssh: connect to host localhost port 22: Connection refused)
- QT--初识
- pod-test
- pyspark AttributeError: &#39;NoneType&#39; object has no attribute &#39;setCallSite&#39;