C语言随机点名程序

#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#include "windows.h"

void main(){
  srand(time(NULL));
  int num = rand()%3;
  char name[3][7] = {"张三","李四","王五"};
  printf("%s\n",name[num]);
  system("pause");
}

posted @   laoluoits  阅读(6531)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示