void wyyxt() { system("color 70"); system("mode con:cols=80 lines=30"); system("cls"); printf("\n"); printf("\t-------------欢迎使用本网易云音乐系统------------\n"); printf("\t-------------------------------------------------\n"); printf("\t--------------------1. 发现----------------------\n"); printf("\t--------------------2. 音乐----------------------\n"); printf("\t--------------------3. 我的----------------------\n"); printf("\t--------------------0. 退出----------------------\n"); printf("\t-------------------------------------------------\n"); }增添动态边框
时间: 2023-07-02 08:16:26 浏览: 44
可以使用 ASCII 码来绘制动态边框,然后将其嵌入到你的函数中。以下是一个简单的实现示例:
```c
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
void wyyxt() {
system("color 70");
system("mode con:cols=80 lines=30");
system("cls");
// 定义边框字符
char border[20][40] = {
"╔══════════════════════════════════════════════════╗",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"╚══════════════════════════════════════════════════╝"
};
// 打印边框
for (int i = 0; i < 20; i++) {
printf("%s\n", border[i]);
}
// 打印菜单
printf("\t\t\t欢迎使用本网易云音乐系统\n");
printf("\t\t\t------------------------\n");
printf("\t\t\t1. 发现\n");
printf("\t\t\t2. 音乐\n");
printf("\t\t\t3. 我的\n");
printf("\t\t\t0. 退出\n");
// 打印底部边框
for (int i = 0; i < 20; i++) {
printf("%s\n", border[i]);
}
}
int main() {
wyyxt();
return 0;
}
```
这段代码会在命令行窗口中打印一个带有动态边框的菜单。你可以根据需要修改边框字符的样式和菜单内容。
相关推荐
![ino](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)