标签:
#include <stdio.h> #include <stdlib.h> #include <time.h> int main() { char str[95]; char pstr[11]; int i; int x; int y; srand((unsigned) time(0)); for (i = 0; i < 94; i++) { str[i] = (char)(i + 33); } for (y = 0; y < 10; y++) { for (i = 0; i < 10; i++) { x = rand() % 94; pstr[i] = str[x]; } pstr[10] = ‘\0‘; //防止越界出现“烫”。 printf("%s\n", pstr); } return 0; }
标签:
原文地址:http://www.cnblogs.com/jhcla/p/5124109.html