void customize1() { int s; switch (customize()) { case 1://自定义速度 system("cls"); gotoxy(8, 8); printf("\t\t\t\t请输入速度(1-999)"); scanf("%d", &s); speed = (1000 - s); break; case 2: system("cls"); gotoxy(8, 8); printf("\t\t\t\t请输入初始长度:"); scanf("%d", &s); len = s; break; default: break; }
时间: 2024-04-05 20:35:20 浏览: 13
这段代码是用来处理用户自定义设置的函数 `customize1()` 中的 `switch` 语句,根据用户选择的不同,会执行不同的操作。具体来说,`customize()` 函数返回用户选择的选项,然后在 `customize1()` 函数内部根据不同选项执行相应的代码。其中:
- `case 1` 对应用户选择自定义速度,清屏后提示用户输入速度,然后将 `speed` 变量赋值为 `1000 - s`,即速度越大,`speed` 变量的值越小。
- `case 2` 对应用户选择自定义初始长度,清屏后提示用户输入初始长度,然后将 `len` 变量赋值为 `s`。
- `default` 对应用户选择其他选项,不执行任何操作。
同时需要注意的是,在这段代码中没有对用户输入进行任何的合法性检查,如果用户输入了错误的值,程序可能会出现异常行为。
相关问题
/xms/customize/index#/dashboard:dashboard
根据提供的引用内容,"/xms/customize/index#/dashboard:dashboard"是一个URL路径。根据引用\[1\]中的代码,可以看出该路径是被拦截器所拦截的。拦截器的配置是通过实现WebMvcConfigurerAdapter接口来实现的。在addInterceptors方法中,使用addPathPatterns方法来指定需要拦截的路径模式,而使用excludePathPatterns方法来指定不需要拦截的路径模式。根据引用\[2\]中的解释,"/**"表示访问当前项目的任何资源,而静态资源的文件夹包括"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"。因此,"/xms/customize/index#/dashboard:dashboard"这个路径会被拦截器拦截。
#### 引用[.reference_title]
- *1* *2* [springBoot学习](https://blog.csdn.net/flying_ingo/article/details/111830817)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Elastic:使用 Elastic Stack 来监督 Apache 日志及指标](https://blog.csdn.net/UbuntuTouch/article/details/121783141)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
将https://fonts.googleapis.com/css转换为本地路径应该怎么写
将 Google Fonts 的 CSS 文件转换为本地路径,可以按照以下步骤进行操作:
1. 首先,打开 Google Fonts 的网站,选择你需要使用的字体,并在页面顶部选择“Family Selected”选项卡。
2. 在“Family Selected”选项卡中,你可以看到一个“Customize”按钮。点击它,你可以选择不同的字体风格和字符集,以定制你的字体。
3. 定制完毕后,点击“Embed”选项卡,你可以看到一个链接地址,形如:https://fonts.googleapis.com/css?family=Font+Name:400,700。
4. 将该链接地址中的 “https://fonts.googleapis.com/css” 改为本地路径,例如,“./fonts/font-name.css”,然后将该路径添加到你的 HTML 文件中的<head>标签中。
5. 下载该字体文件并放置到你指定的“fonts”文件夹中。
6. 最后,在你的 CSS 文件中,使用 @font-face 规则将字体文件链接到你的样式表中,例如:
``` css
@font-face {
font-family: 'Font Name';
src: url('../fonts/font-name.woff2') format('woff2'),
url('../fonts/font-name.woff') format('woff');
font-weight: normal;
font-style: normal;
}
```
这样,你就可以在本地使用 Google Fonts 字体了。