vault backup: 2026-01-23 19:52:38

This commit is contained in:
2026-01-23 19:52:38 +08:00
parent e52f181e39
commit 2d0f52e3ad
2 changed files with 31 additions and 2 deletions

View File

@@ -23,6 +23,20 @@
"title": "相关网站" "title": "相关网站"
} }
}, },
{
"id": "417cedc6fc7b40cb",
"type": "leaf",
"state": {
"type": "webviewer",
"state": {
"url": "http://music.zbright.top/",
"title": "道理鱼音乐管理",
"mode": "webview"
},
"icon": "globe-2",
"title": "道理鱼音乐管理"
}
},
{ {
"id": "6bbdb6c9df9a2d8f", "id": "6bbdb6c9df9a2d8f",
"type": "leaf", "type": "leaf",
@@ -67,7 +81,7 @@
} }
} }
], ],
"currentTab": 3 "currentTab": 4
}, },
{ {
"id": "84db982cf765aaad", "id": "84db982cf765aaad",
@@ -318,10 +332,10 @@
}, },
"active": "1fec176bb492eafb", "active": "1fec176bb492eafb",
"lastOpenFiles": [ "lastOpenFiles": [
"YueQian/相关网站.md",
"YueQian/Homework/1.23.md", "YueQian/Homework/1.23.md",
"Collection/YoudaoyunNotes/01Linux基础/02_Linux概述.md", "Collection/YoudaoyunNotes/01Linux基础/02_Linux概述.md",
"BlogWebsite/Article/MarkdownTest.md", "BlogWebsite/Article/MarkdownTest.md",
"YueQian/相关网站.md",
"Collection/连~都忘记了的小知识.md", "Collection/连~都忘记了的小知识.md",
"Diary/2026-1/2026-1-23 周五.md", "Diary/2026-1/2026-1-23 周五.md",
"Diary/2026-1/2026-1-22 周四.md", "Diary/2026-1/2026-1-22 周四.md",

View File

@@ -65,7 +65,19 @@ int main(int argc, char const *argv[])
``` ```
4.定义字符串`char *name = "Programmer"`,分别输出完整字符串、前 5 个字符、左对齐占 10 位、右对齐占 10 位的格式; 4.定义字符串`char *name = "Programmer"`,分别输出完整字符串、前 5 个字符、左对齐占 10 位、右对齐占 10 位的格式;
```c ```c
#include <stdio.h>
int main(int argc, char const *argv[])
{
    char *name = "Programmer";
    printf("%s\n",name);
    printf("%.5s\n",name);
    printf("%-10.5s\n",name);
    printf("%10.5s\n",name);
    return 0;
}
``` ```
5.编写一个综合程序结合格式化输入输出、类型转换、IO 流知识点,实现 “字符↔ASCII 码” 双向转换: 5.编写一个综合程序结合格式化输入输出、类型转换、IO 流知识点,实现 “字符↔ASCII 码” 双向转换:
1. 提示用户选择功能:输入 1字符转 ASCII、2ASCII 转字符); 1. 提示用户选择功能:输入 1字符转 ASCII、2ASCII 转字符);
@@ -73,3 +85,6 @@ int main(int argc, char const *argv[])
3. 若选择 2接收用户输入的 ASCII 码值0-127输出对应的字符int→char显式转换 3. 若选择 2接收用户输入的 ASCII 码值0-127输出对应的字符int→char显式转换
4. 增加输入校验:若输入的 ASCII 码超出 0-127 范围,输出 “无效的 ASCII 码”;若输入的不是单个字符,输出 “输入格式错误”; 4. 增加输入校验:若输入的 ASCII 码超出 0-127 范围,输出 “无效的 ASCII 码”;若输入的不是单个字符,输出 “输入格式错误”;
5. 核心要求使用scanf的返回值判断输入是否有效结合格式化控制符完成输入输出 5. 核心要求使用scanf的返回值判断输入是否有效结合格式化控制符完成输入输出
```c
```