#include <stdio.h>
#include <stdlib.h>
#include<time.h>
int main()
{
char* a[8]={"\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■"};
int i,j,k;
printf("\n随机输出8张5行5列色块图像:\n\n");
srand(time(NULL)); // 种子
for (i=0;i<2;i++)
for (j=0;j<3;j++)
{
for (k=0;k<3;k++)
printf("%s%s%s\n",a[rand()%8],a[rand()%8],a[rand()%8]);
printf("\n\n");
}
}
安卓版的c语言编译器c语言输出随机颜色图像代码
最新推荐文章于 2024-08-19 16:02:04 发布