电脑代码雨简单代码变颜色(电脑代码雨怎么弄)

http://www.itjxue.com  2023-02-03 17:57  来源:未知  点击次数: 

编程如何让代码符号变成粉红色

答案如下:

可以用“color”属性修改编程代码符号的颜色。

1.新建html文档,在body标签中添加题目中的代码;

2.在head标签中添加style标签,然后在style标签中添加“lia”选择器,“lia”表示的是选中li标签的子标签a标签;

3.添加“color”属性,属性值为文字的颜色,这里以“red”为例,这时文字的颜色就会变成粉红色。

C语言,怎么使打出的代码是彩色的

1、可以调用dos控制台的命令system("color xx");改变文字颜色。设置默认的控制台文字和背景颜色。COLOR [attr]attr 指定控制台输出的颜色属性颜色属性由两个十六进制数字指定 -- 第一个为背景,第二个则为文字。每个数字可以为以下任何值之一:0 = 黑色 8 = 灰色1 = 蓝色 9 = 淡蓝色2 = 绿色 A = 淡绿色3 = 浅绿色 B = 淡浅绿色4 = 红色 C = 淡红色5 = 紫色 D = 淡紫色6 = 黄色 E = 淡黄色7 = 白色 F = 亮白色如果没有给定任何参数,该命令会将颜色还原到 CMD.EXE 启动时的颜色

如何实现c语言程序各颜色数字雨代码

#includestdio.h

#includetime.h

#includewindows.h

typedef struct

{

int x,y;

char ch;

}STU;

STU st[100];

//出现位置?

void gotoxy(int x, int y)

{

? HANDLE hout;

? COORD pos;

? pos.X = x;

? pos.Y = y;

? hout = GetStdHandle(STD_OUTPUT_HANDLE);

? SetConsoleCursorPosition(hout, pos);

}

/*隐藏光标*/

void show_cursor(int hide)

{

? CONSOLE_CURSOR_INFO cciCursor;

? HANDLE hout;

? hout = GetStdHandle(STD_OUTPUT_HANDLE);

? if(GetConsoleCursorInfo(hout, cciCursor))

? {

? ? ? cciCursor.bVisible = hide;

? ? ? SetConsoleCursorInfo(hout, cciCursor);

? }

}

/*设置颜色*/

void set_color(int color)

{

? SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);

}

main()

{

int i,j;

show_cursor(0);

srand(time(NULL));

//初始化结构体

for (i=0;i100;i++)

{

st[i].x = rand()%80;

st[i].y = rand()%20;

st[i].ch = rand()%(49-47)+48;

}

while (1)

{

for (i=0;i100;i++)

{

gotoxy(st[i].x,st[i].y);

set_color(0x2);//最先出现的颜色;

putchar(st[i].ch);

gotoxy(st[i].x,st[i].y-5);

putchar(' ');

st[i].y++;

st[i].ch = rand()%(49-47)+48;

if (st[i].y-5=18)

{

gotoxy(st[i].x,st[i].y-1);

putchar(' ');

gotoxy(st[i].x,st[i].y-2);

putchar(' ');

gotoxy(st[i].x,st[i].y-3);

putchar(' ');

gotoxy(st[i].x,st[i].y-4);

putchar(' ');

gotoxy(st[i].x,st[i].y-4);

putchar(' ');

}

if (st[i].y 23)

{

st[i].x = rand()%80;

st[i].y = rand()%20;

}

gotoxy(st[i].x,st[i].y);

set_color(0xA);//由前一个颜色渐变成的颜色

putchar(st[i].ch);

}

Sleep(120);

}

}

????color(0);???printf("黑色\n");??????color(1);???printf("蓝色\n");??????color(2);???printf("绿色\n");???????color(3);???printf("湖蓝色\n");??????color(4);???printf("红色\n");??????color(5);???printf("紫色\n");??????color(6);???printf("黄色\n");???????color(7);???printf("白色\n");??????color(8);???printf("灰色\n");??????color(9);???printf("淡蓝色\n");??????color(10);??printf("淡绿色\n");??????color(11);??printf("淡浅绿色\n");???????color(12);??printf("淡红色\n");??????color(13);??printf("淡紫色\n");??????color(14);??printf("淡黄色\n");??????color(15);??printf("亮白色\n")

几个基本的颜色;

如何用代码改字体颜色?

1、font标签可直接使用color来调整颜色,如:

font

color="#FF0000"红色/font

2、所有可加载文字的标签可以直接使用style中的color来调整颜色,如:

span

style="color:#FFFFFF"白色/span

3、可以通过style事先设置一个颜色,然后通过class来调用,如

style

type="text/css".green{color:#33FF00}/style

div

class="green"绿色/div

(责任编辑:IT教学网)

更多

推荐网站经济文章