#include <stdio.h>
#include <stdlib.h>
#include<time.h>
int main()
{
char* a[16]={“\033[30;30;4m■”,“\033[30;31;4m■”,“\033[30;32;4m■”,“\033[30;33;4m■”,“\033[30;34;4m■”,“\033[30;35;4m■”,“\033[30;36;4m■”,“\033[30;37;4m■”,“\033[40;30;4m■”,“\033[40;31;4m■”,“\033[40;32;4m■”,“\033[40;33;4m■”,“\033[40;34;4m■”,“\033[40;35;4m■”,“\033[40;36;4m■”,“\033[40;37;4m■”};
int i,j,k;
printf(“\n随机输出8张5行5列色块图像:\n\n”);
srand(time(NULL)); // 种子
for (i=0;i<8;i++)
for (j=0;j<5;j++)
{
for (j=0;j<5;j++)
printf(“%s%s%s%s%s%s\n”,a[rand()%16],a[rand()%16],a[rand()%16],a[rand()%16],a[rand()%16],a[rand()%16]);
printf(“\n”);
}
}