随机点名

/*
字符串数组:由若干个字符串组成的多串字符,所以叫字符串数组。


*/
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
void main()
{
char name[39][7]={"莫家宁","王涛","黄俊峰","蒙仲昊","雷华炎","刘绍源","叶小龙","李家杰","谢立转","孙登磊","李武忠","张惠山","吴勇行","张隆","苏邓关","吉俊强","黄志平","黄成杰","黄益强","胡 尉","邹秀芳","覃朝桂","胡青山","谢卓洲","严济文","陈世成","梁伟权","谭竣升","邓航程","林金山","孙德亮","黄成尧","陈辉杰","肖丹蕾","徐童","范思逸","曹同军","王汉乾","龚晓强"};
int NO,i;

srand((unsigned)time(NULL));

for(i=1;i<=10;i++)
NO=rand()%39;
puts(name[NO]);
}

 

posted on 2018-03-29 12:41  黄志平  阅读(227)  评论(0编辑  收藏  举报

导航