#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]) {
float x, y, a;
for (y = 1.5;y > -1.5;y -= 0.1) {
for (x = -1.5;x < 1.5;x += 0.05) {
a = x * x + y * y - 1;
putchar(a * a * a - x * x * y * y * y <= 0.0 ? '@' : ' ');
}
system("color 0c");
putchar('\n');
}
printf(" 送您一个爱心");
printf("\n\n");
return 0;
}
The code effect is as shown in the figure
Color properties are specified by two hexadecimal digits -- the first
corresponds to the background and the second to the foreground. every number
Can be any of the following values:
0 = black 8 = gray
1 = blue 9 = light blue
2 = green A = light green
3 = light green B = light light green
4 = red C = light red
5 = Purple D = Lilac
6 = yellow E = light yellow
7 = white F = bright white
If no arguments are given, this command will revert the colors to when CMD.EXE was started
s color. This value comes from the current console window /T command line switch or the DefaultColor registry
value.
The text can be modified, and you can also change the code according to your needs~