#include<stdio.h> #include<stdlib.h> #include<math.h> #include<time.h> int main() { int a[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; int n=16; int i,j,T=1000,tmp; srand(unsigned(time(NULL))); while(T--) { i=rand()%n; j=rand()%n; tmp=a[i]; a[i]=a[j]; a[j]=tmp; } for(i=0;i<n;i++) printf("%d ",a[i]); puts(""); return 0; }
C语言打乱一组数字顺序
原创
©著作权归作者所有:来自51CTO博客作者umgsai的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
1.顺序表的实现——C语言
顺序表各种操作的代码实现
顺序表 冒泡排序 算法 随机数 -
C语言学习Part1(1-1000行代码)
记录系统学习C语言的过程
操作符 八进制 #include -
Java list顺序打乱
Java list顺序打乱
List System i++ -
OverTheWire Bandit Writeup (1-10)
规则是每一关利用提供的主机加端口和上一关得到...
txt文件 linux 隐藏文件 -
Natas通关指南(1-10)
到网站的漏洞获得通往下一关的密码。每一关都有一...
php Access 3d