無意中找到的
#X&J9n%q%](}/w-B)i"h
1 #include "iostream.h" www.phate.tw3F3R!y"`;p(o;_%I.j(j#x
2 #include "windows.h"
3 main() ;s:Y4]#I8~*e5i%B:~!T/S
4 { www.phate.tw5B/};?'U9R+Q2g4v4]
5 printf("以下為前景字顏色\n");
6 //紅色 |+o*@(w,z4}'`7}%t"I
7 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED); www.phate.tw:g!|%R9h8Y%R
8 printf("Hello(Red)\n");
9 //藍色
10 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_GREEN);
11 printf("Hello(Green)\n");
12 //綠色
13 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_BLUE);
14 printf("Hello(Blue)\n"); ,|%D h(o&k:],F-z$U
15 //黃色=紅+綠 www.phate.tw1R2C(b9j5_%}
16 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN);
17 printf("Hello(Yellow)\n");
18 //紫色=紅+藍 .a7_$Z;X!R5o7i,t6h
19 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE); .: Phate Technology :.#B0Q;v4o0t
20 printf("Hello(Purple)\n"); +Y3i:E)@ m&U
21 //青綠色=綠+藍
22 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE); 5x,n"a$m$B!m(q
23 printf("Hello(Cyan)\n"); .: Phate Technology :.!x7x8^ k8_8X'L7@%~&p
24 //白色=紅+綠+藍 (`.g&^/F1y2`,f
25 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
26 printf("Hello(White)\n\n");
27 !P!f3j$D4M7Y4Q9k
28 printf("以下為背景顏色\n"); #Q4|*O1I9f
29 //背景紅色 "R+E*D,f#j:O!Z*Z
30 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_RED);
31 printf("Hello(Back_Red)\n");
32 //背景藍色
33 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_BLUE);
34 printf("Hello(Back_Blue)\n");
35 //背景綠色 +d'Y(g5e S
36 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_GREEN);
37 printf("Hello(Back_Green)\n");
38 //背景黃色=紅+綠 .: Phate Technology :..\9s;X6|'X(m9`"~
39 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN); www.phate.tw#?4\.c {8s:p2w:P7g0^(c
40 printf("Hello(Back_Yellow)\n"); 9t$K1e${*e2T
41 //背景紫色=紅+藍 +k'F2p:X8X*? T8P5E
42 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_BLUE); 8^8Q0^5R0F$u$F
43 printf("Hello(Back_Purple)\n");
44 //背景青綠色=綠+藍 ;b8W+Q7K%r$g#x'L;}2h
45 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_GREEN | BACKGROUND_BLUE);
46 printf("Hello(Back_Cyan)\n");
47 //背景白色=紅+綠+藍 $e2s0^4n%B.K
48 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);
49 printf("Hello(Back_White)\n"); .: Phate Technology :.7t.g3r9I!b y
50 getchar();
51 }
#X&J9n%q%](}/w-B)i"h
1 #include "iostream.h" www.phate.tw3F3R!y"`;p(o;_%I.j(j#x
2 #include "windows.h"
3 main() ;s:Y4]#I8~*e5i%B:~!T/S
4 { www.phate.tw5B/};?'U9R+Q2g4v4]
5 printf("以下為前景字顏色\n");
6 //紅色 |+o*@(w,z4}'`7}%t"I
7 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED); www.phate.tw:g!|%R9h8Y%R
8 printf("Hello(Red)\n");
9 //藍色
10 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_GREEN);
11 printf("Hello(Green)\n");
12 //綠色
13 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_BLUE);
14 printf("Hello(Blue)\n"); ,|%D h(o&k:],F-z$U
15 //黃色=紅+綠 www.phate.tw1R2C(b9j5_%}
16 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN);
17 printf("Hello(Yellow)\n");
18 //紫色=紅+藍 .a7_$Z;X!R5o7i,t6h
19 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE); .: Phate Technology :.#B0Q;v4o0t
20 printf("Hello(Purple)\n"); +Y3i:E)@ m&U
21 //青綠色=綠+藍
22 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE); 5x,n"a$m$B!m(q
23 printf("Hello(Cyan)\n"); .: Phate Technology :.!x7x8^ k8_8X'L7@%~&p
24 //白色=紅+綠+藍 (`.g&^/F1y2`,f
25 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
26 printf("Hello(White)\n\n");
27 !P!f3j$D4M7Y4Q9k
28 printf("以下為背景顏色\n"); #Q4|*O1I9f
29 //背景紅色 "R+E*D,f#j:O!Z*Z
30 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_RED);
31 printf("Hello(Back_Red)\n");
32 //背景藍色
33 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_BLUE);
34 printf("Hello(Back_Blue)\n");
35 //背景綠色 +d'Y(g5e S
36 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_GREEN);
37 printf("Hello(Back_Green)\n");
38 //背景黃色=紅+綠 .: Phate Technology :..\9s;X6|'X(m9`"~
39 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN); www.phate.tw#?4\.c {8s:p2w:P7g0^(c
40 printf("Hello(Back_Yellow)\n"); 9t$K1e${*e2T
41 //背景紫色=紅+藍 +k'F2p:X8X*? T8P5E
42 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_BLUE); 8^8Q0^5R0F$u$F
43 printf("Hello(Back_Purple)\n");
44 //背景青綠色=綠+藍 ;b8W+Q7K%r$g#x'L;}2h
45 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_GREEN | BACKGROUND_BLUE);
46 printf("Hello(Back_Cyan)\n");
47 //背景白色=紅+綠+藍 $e2s0^4n%B.K
48 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY | FOREGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);
49 printf("Hello(Back_White)\n"); .: Phate Technology :.7t.g3r9I!b y
50 getchar();
51 }
沒有留言:
張貼留言