本书标签: 现代  需要的可以用 

无题

第1本书(原软)
include
include

<stdio.h>

include
include

<windows.h>

// 设置控制台颜色

void setColor(int color) {

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);

}

// 打印一个彩色按键(键帽内含字符)

void printKey(const char *label, int color) {

setColor(color);

printf("┌───────┐ ");

setColor(7);

}

void printKeyMid(const char *label, int color) {

setColor(color);

printf("│ %-5s │ ", label);

setColor(7);

}

void printKeyBot(const char *label, int color) {

setColor(color);

printf("└───────┘ ");

setColor(7);

}

int main() {

SetConsoleOutputCP(65001); // UTF-8

system("cls");

// 颜色代码: 9=蓝 10=绿 11=青 12=红 13=紫 14=黄 15=白

int colors1[] = {12, 13, 14, 11, 10, 9, 15, 12, 13, 14};

int colors2[] = {9, 10, 11, 12, 13, 14, 15, 9, 10, 11};

int colors3[] = {14, 12, 10, 13, 11, 9, 12, 15, 14, 13};

const char *keys1[] = {"Q","W","E","R","T","Y","U","I","O","P"};

const char *keys2[] = {"A","S","D","F","G","H","J","K","L",";"};

const char *keys3[] = {"Z","X","C","V","B","N","M",",",".","/"};

// 顶部:苏新皓 Q版形象(ASCII画)

setColor(13);

printf(" (\\_/) \n");

printf(" ( ^_^ ) <-- 苏新皓 Q版\n");

printf(" /|_|\\ \n");

setColor(7);

printf("\n");

int n = 10;

for (int i = 0; i < n; i++) printKey(keys1[i], colors1[i]);

printf("\n");

for (int i = 0; i < n; i++) printKeyMid(keys1[i], colors1[i]);

printf("\n");

for (int i = 0; i < n; i++) printKeyBot(keys1[i], colors1[i]);

printf("\n\n");

for (int i = 0; i < n; i++) printKey(keys2[i], colors2[i]);

printf("\n");

for (int i = 0; i < n; i++) printKeyMid(keys2[i], colors2[i]);

printf("\n");

for (int i = 0; i < n; i++) printKeyBot(keys2[i], colors2[i]);

printf("\n\n");

for (int i = 0; i < n; i++) printKey(keys3[i], colors3[i]);

printf("\n");

for (int i = 0; i < n; i++) printKeyMid(keys3[i], colors3[i]);

printf("\n");

for (int i = 0; i < n; i++) printKeyBot(keys3[i], colors3[i]);

printf("\n");

setColor(15);

printf("\n按任意键退出...\n");

getchar();

return 0;

}

这个是关于苏新皓的键盘软件,感兴趣的可以试一下