linux rand application
Posted michellel.top
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux rand application相关的知识,希望对你有一定的参考价值。
code:
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 5 #define random_1(a, b) ((rand()%(b - a)) + a) 6 #define random_2(a, b) ((rand()%(b - a + 1)) + a) 7 8 int main(int argc, char **argv) 9 { 10 srand((int)time(NULL)); 11 int arr[10]; 12 for(int i = 0; i < 10; i++){ 13 arr[i] = random_1(1, 20); 14 } 15 16 for(int i = 0; i < 10; i++){ 17 printf("%d ", arr[i]); 18 } 19 20 21 return 0; 22 }
以上是关于linux rand application的主要内容,如果未能解决你的问题,请参考以下文章
flink1.11报错:java.lang.IllegalStateException: No ExecutorFactory found to execute the application(代码片
3.springboot:springboot配置文件(配置文件YAML属性文件值注入<@Value@ConfigurationProperties@PropertySource,@Im(代码片
3springboot:springboot配置文件(配置文件YAML属性文件值注入<@Value@ConfigurationProperties@PropertySource,@Imp(代码片
Linux内核分析:完成一个简单的时间片轮转多道程序内核代码