1010 Radix (25 分)

1010 RadixGiven a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integers N​1​​ and N​2​​, your task is to find the
分类: 其他 发布时间: 03-06 09:12 阅读次数: 0

c++中二分查找中的binary_search,lower_bound,upper_bound

注意:如果数组无序,请先用sort将数组排序binary_search(起始地址,结束地址,要查找的数值)返回值是 是否存在这么一个数,是一个bool值。#include<bits/stdc++.h>using namespace std;int a[100005];int main(){ int n; cin >> n; for(int i=0; i<n; i++) { cin >> a[i]; } sort(a,a+n);
分类: 其他 发布时间: 03-06 09:11 阅读次数: 0

c++ 判断字符是否是数字或字母(以及大小写转换)

transform 字符串str的大小写转换transform(str.begin(), str.end(), str.begin(), 转换操作);#include<bits/stdc++.h>using namespace std;int main(){ string str = "abcdAA123"; // 将字符串str全部转化为大写 transform(str.begin(), str.end(), str.begin(), ::toupper); cout
分类: 其他 发布时间: 03-06 09:10 阅读次数: 0

1089 Insert or Merge (25 分)

1089 Insert or MergeAccording to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs withi
分类: 其他 发布时间: 03-06 09:10 阅读次数: 0

在Dev-Cpp中使用C++11中的函数

stoi、to_string、unordered_map、unordered_set、auto在Dev-Cpp默认不可使用,按如下步骤操作之后就可以使用了添加-std=c++11
分类: 其他 发布时间: 03-06 09:09 阅读次数: 0

c++中string字符串和数字类型的转换

使用流实现数字类型转为string字符串#include<bits/stdc++.h>using namespace std;int main(){ int n = 123; stringstream ss; string str; ss << n; ss >> str; cout << str; return 0;}string字符串转为数字类型#include<bits/stdc++.h>us
分类: 其他 发布时间: 03-06 09:09 阅读次数: 0

1049 Counting Ones (22/30 分)

1049 Counting OnesThe task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N being 12, there are five 1’s in 1, 10, 11, and 12.Input Specificat
分类: 其他 发布时间: 03-06 09:09 阅读次数: 0

SpringBoot2-配置类及配置绑定

用法:@ConfigurationProperties(prefix = “xxx”)此用法多用于配置类,初始化类的属性值
分类: 其他 发布时间: 03-06 09:08 阅读次数: 0

Spring的IOC和AOP原理及其使用

传统模式Spring的处理方式
分类: 其他 发布时间: 03-06 09:07 阅读次数: 0

Spring常用xml配置详解

引入外部properties文件 注解扫描包
分类: 其他 发布时间: 03-06 09:07 阅读次数: 0

Spring常用注解开发

@Configuration :@Target({ElementType.TYPE})告诉Spring这是一个配置类@ComponentScan(basePackages = “com.frank”)@Target({ElementType.TYPE})扫描包下面的组件@Bean@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})注册一个bean:bean的id是方法名@Scope(“singleton”)@Target..
分类: 其他 发布时间: 03-06 09:07 阅读次数: 0

Spring-MVC:Model,ModelAndView和跳转页面的用法

分类: 其他 发布时间: 03-06 09:07 阅读次数: 0

Spring-MVC:ajax请求与响应

添加依赖:<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.12.1</version></dependency><dependency> <groupId>com.fasterxml.ja.
分类: 其他 发布时间: 03-06 09:06 阅读次数: 0

SpringBoot - Banner,多环境

Banner可以通过将banner.txt文件添加到类路径或将spring.banner.location属性设置为此类文件的位置来更改启动时打印的横幅。如果文件的编码不是UTF-8,则可以设置spring.banner.charset。除了一个文本文件,你还可以添加一个banner.gif,banner.jpg或banner.png图像文件到类路径或设置spring.banner.image.location属性。多环境properties 格式全局配置文件的做法:默认必须要有 appl
分类: 其他 发布时间: 03-06 09:06 阅读次数: 0

SpringBoot - 拦截器

拦截器两个步骤:实现HandlerInterceptor接口创建拦截器public class LoginInterceptor implements HandlerInterceptor { /** * 发送请求之前执行 * * @param request * @param response * @param handler * @return * @throws Exception */ @Overr
分类: 其他 发布时间: 03-06 09:06 阅读次数: 0

SpringBoot - 文件上传

文件上传表单页面://请求方法必须为post,编码类型enctype必须为multipart/form-data<form method="post" action="/upload" enctype="multipart/form-data"> //单文件上传,accept设置上传文件只能是照片 <input type="file" name="object" accept="image/*"><br/> //多文件上传 <inpu
分类: 其他 发布时间: 03-06 09:06 阅读次数: 0

SpringBoot - 异常处理

异常处理默认规则:默认情况下,Spring Boot提供/error处理所有错误的映射对于机器客户端,它将生成JSON响应,其中包含错误,HTTP状态和异常消息的详细信息。对于浏览器客户端,响应一个“ whitelabel”错误视图,以HTML格式呈现相同的数据机器客户端(Postman):- 浏览器客户端: 自定义错误页面:直接将404.html和5xx.html页面放在resoures/static/error/文件夹下面自定义异常处理:@Configuratio
分类: 其他 发布时间: 03-06 09:05 阅读次数: 0

Mybatis - 环境搭建

环境搭建导入依赖坐标:<!--驱动--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.6</version> </dependency>
分类: 其他 发布时间: 03-06 09:05 阅读次数: 0

Mybatis - mybatis-config.xml

configuration配置properties(属性):<properties resource="jdbc.properties"/><!--根据引入的文件获取值--><dataSource type="POOLED"> <property name="driver" value="${driver}"/> <property name="url" value="${url}"/> <propert
分类: 其他 发布时间: 03-06 09:05 阅读次数: 0

Mybatis - 一对一,一对多,多对多

一对一:汽车表Car对用户表User是一对一关系pojopublic class Car implements Serializable { private Integer id; private String name; private Integer uId; private User user; public Integer getId() { return id; } public void setId(Integ
分类: 其他 发布时间: 03-06 09:04 阅读次数: 0