#include <math.h>
#include <graphics.h>
int size, color = 1
void *save1, *save2
void save()
void dsnow()
void font()
struct Snow
{
int x
int y
int speed
} snow[100]
void save()
{
int i, x, y
setcolor(WHITE)
for (i = 1i <= 6i++)
{
x = 200+5 * sin(i *3.1415926 / 3)
y = 200-5 * cos(i *3.1415926 / 3)
line(200, 200, x, y)
}
size = imagesize(195, 195, 205, 205)
save1 = malloc(size)
save2 = malloc(size)
getimage(195, 195, 205, 205, save1)
getimage(100, 100, 110, 110, save2)
}
void font()
{
setcolor(color)
settextstyle(0, 0, 4)
outtextxy(80, 200, "HAPPPY NEW YEAR")
color++
if (color >15)
color =1
}
void dsnow()
{
int a[66], i, num = 0
randomize()
for (i = 0i <66i++)
a[i] = (i - 2) *10
cleardevice()
while (!kbhit())
{
font()
if (num != 100)
{
snow[num].speed = 2+random(10)
i = random(66)
snow[num].x = a[i]
snow[num].y = 0
}
for (i = 0i <numi++)
putimage(snow[i].x, snow[i].y, save2, COPY_PUT)
font()
if (num != 100)
num++
for (i = 0i <numi++)
{
snow[i].y += snow[i].speed
putimage(snow[i].x, snow[i].y, save1, COPY_PUT)
if (snow[i].y >500)
snow[i].y = 0
}
}
}
main()
{
int gdriver = DETECT, gmode
initgraph(&gdriver, &gmode, "")
save()
dsnow()
getch()
closegraph()
}
#include <stdio.h>int main()
{
int i, j, k, l, m
char c = '*' //ASCII码里面 3 就是一个字符小爱心
for (i = 1i <= 5i++)
printf("\n") //开头空出5行
for (i = 1i <= 4i++)
{ //前3行中间有空隙分开来写
for (j = 1j <= 32 - 2 * ij++)
printf(" ") //左边的空格,每下一行左边的空格比上一行少2个 //8*n-2*i
for (k = 1k <= 4 * i - 2k++)
printf("%c", c) //输出左半部分字符小爱心
for (l = 1l <= 17 - 4 * il++)
printf(" ") //中间的空格,每下一行的空格比上一行少4个
for (m = 1m <= 4 * i - 2m++)
printf("%c", c) //输出右半部分字符小爱心
printf("\n") //每一行输出完毕换行
}
for (i = 1i <= 3i++)
{ //下3行中间没有空格
for (j = 1j <= 22 + 1j++)
printf(" ") //左边的空格 //8*(n-1)+1
for (k = 1k <= 31k++)
printf("%c", c) //输出字符小爱心
printf("\n") //每一行输出完毕换行
}
for (i = 7i >= 1i--)
{ //下7行
for (j = 1j <= 38 - 2 * ij++)
printf(" ") //左边的空格,每下一行左边的空格比上一行少2个//8*(n+1)-2*i
for (k = 1k <= 4 * i + 1k++)
printf("%c", c) //每下一行的字符小爱心比上一行少4个(这个循环是i--)
printf("\n") //每一行输出完毕换行
}
for (i = 1i <= 38i++)
printf(" ") //最后一行左边的空格
printf("%c", c) //最后一个字符小爱心
for (i = 1i <= 5i++)
printf("\n") //最后空出5行
return 0
}
1,用样式表(css),在组件里面加上style属性,例如:
<div style="background-color:bluefont-family:宋体">
欢迎你
</div>
2,直接在字体两边加font标记,例如:
<font color=blue >欢迎你</font>
扩展资料
<input name="submit" type="submit" value="changeColor" onClick="changeColor()">
<span id="wenzi">wenzi</span>
<script>
function changeColor(){
document.all['wenzi'].style.color="#ff0000"
}
</script>
参考资料:百度百科 CSS(层叠样式表)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)