- 博客(135)
- 收藏
- 关注
转载 @responseBody
1、 @responseBody注解的作用是将controller的方法返回的对象通过适当的转换器转换为指定的格式之后,写入到response对象的body区,通常用来返回JSON数据或者是XML 数据,需要注意的呢,在使用此注解之后不会再走试图处理器,而是直接将数据写入到输入流中,他的效果等同于通过response对象输出指定格式的数据。2、 @RequestMappi...
2018-11-22 11:06:00
603
原创 React the server responded with a status of 404 (Not Found)
把HTML文件放到和build文件夹一起了<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <title>react_demo12</title> <s
2018-11-09 10:17:55
1297
原创 session.commit();
public static void updateStudentByStuno() throws IOException { //加载MyBatis配置文件(为了访问数据库) Reader reader = Resources.getResourceAsReader("conf.xml"); SqlSessionFactory sessionFactory = new SqlSes...
2018-11-05 19:01:53
7741
原创 实体类-打印结果错误
org.lanqiao.entity.Student@ae45eb6package org.lanqiao.entity;public class Student { private int stuNo; private String stuName; private int stuAge; public Student() { } public Student(int...
2018-11-05 16:08:38
213
原创 实体类--字符串不能正常输出
hadoop,300,org.lanqiao.entity.Teacher@5fbe4146<bean id="course" class="org.lanqiao.entity.Course" p:courseName="hadoop" p:courseHour="300" p:teacher-ref="teacher"> <!-- <pr
2018-11-03 20:10:02
247
原创 applicationContext.xml ---不可注入的属性类型
<property name="map"> <map> <entry> <key><value>basketball</value></key> <value>篮3</value> &
2018-11-03 19:52:39
282
原创 applicationContext.xml-bean属性错误写法
Could not resolve matching constructor (hint: specify index/type/name arguments for simple paramet 对象的属性类型与applicationContext.xml配置文件ioc的属性类型不一致<constructor-arg value="teacher"/>package o...
2018-11-03 19:44:15
2529
原创 maven--添加编译插件
<build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <t
2018-11-01 21:14:01
741
原创 SM整合-方式二
package org.lanqiao.entity;public class Student { private int stuNo; private String stuName; private int stuAge; public int getStuNo() { return stuNo; } public void setStuNo(int stuNo) { ...
2018-10-29 15:32:14
5624
1
原创 SM整合-方式一
package com.entity;public class Customer { private int cutNo; private String cutName; private int cutAge; public int getCutNo() { return cutNo; } public void setCutNo(int cutNo) { this.c...
2018-10-29 14:47:32
6152
原创 web.xml servlet-mapping 一些补充
如果web.xml中的配置是 <servlet-mapping> <servlet-name>DispatcherServlet</servlet-name> <url-pattern>.action</url-pattern> </servlet-mapping> 则: <...
2018-10-25 17:32:40
193
原创 springMVC配置文件 扫描器
package com.handler;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;//接口/类 注解 配置@Controllerpublic class SpringMVCHandler { // 程...
2018-10-25 16:52:08
490
原创 springmvc.xml约束
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframewo
2018-10-25 16:31:50
278
原创 springmvc jar 包
springmvc jar包在老师上课的时候是说需要导入五个spring也需要的jar包:spring-aop.jar,spring-bean.jar,spring-context.jar,spring-web.jar,spring-core.jar和springmvc需要多一个spring-webmvc.jar但是实践中当写入@Controller时 就会报错 没有这个注解的快捷键提示 是因...
2018-10-25 16:04:11
167
原创 1039. 到底买不买(20)
/*ppRYYGrrYBR2258YrR8RrYppRYYGrrYB225YrR8RrYYes 8No 2*//*解题思路:统计两串的字符,数字,字母*/#include<stdio.h>#include<string.h>void count(char A[],int ans[]){ for(int i=0;i<62;i++) ans[i...
2018-02-24 16:50:41
218
原创 九度oj 1458汉诺塔III解题报告
题目描述:约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下、由小到大顺序串着由64个圆盘构成的塔。目的是将最左边杆上的盘全部移到右边的杆上,条件是一次只能移动一个盘,且不允许大盘放在小盘的上面。现在我们改变游戏的玩法,不允许直接从最左(右)边移到最右(左)边(每次移动一定是移到中间杆或从中间移出),也不允许大盘放到下盘的上面。Daisy已经做过原来的汉诺塔问...
2018-02-24 15:33:23
249
原创 进制转换
#include<stdio.h>#include<string.h>void reverse(char A[]){ for(int i=0,j=strlen(A)-1;i<j;i++,j--){ char tmp=A[i]; A[i]=A[j]; A[j]=tmp; }}void Add(cha...
2018-02-24 14:55:24
224
原创 判断回文数
#include<stdio.h>#include<string.h>int main(){ char str[100]; int i,j; bool flag; while(~scanf("%s",str)){ flag=true; for(i=0,j=strlen(str)-1;i<j;i++,j...
2018-02-21 19:36:42
175
原创 九度OJ1442:A sequence of numbers 解题报告
题目描述:Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of each sequence are...
2018-02-21 14:00:14
225
原创 九度OJ 1087 约数的个数解题报告
题目描述:输入n个整数,依次输出每个数的约数的个数输入:输入的第一行为N,即数组的个数(N<=1000)接下来的1行包括N个整数,其中每个数的范围为(1<=Num<=1000000000)当N=0时输入结束。输出:可能有多组输入数据,对于每组输入数据,输出N行,其中每一行对应上面的一个数的约数的个数。样例输入:51 3 4 6 12样例输出:12346#include&...
2018-02-17 23:24:21
192
原创 九度OJ 1104 整除问题解题报告
题目描述:给定n,a求最大的k,使n!可以被a^k整除但不能被a^(k+1)整除。输入:两个整数n(2<=n<=1000),a(2<=a<=1000)输出:一个整数.样例输入:6 10样例输出:1#include<stdio.h>int main(){ int i,n,a,tmp,k; while(~scanf("%d%d",&n,&a))...
2018-02-17 21:43:29
298
原创 九度OJ 1207质因数的个数解题报告
题目描述:求正整数N(N>1)的质因数的个数。相同的质因数需要重复计算。如120=2*2*2*3*5,共有5个质因数。输入:可能有多组测试数据,每组测试数据的输入是一个正整数N,(1<N<10^9)。输出:对于每组数据,输出N的质因数的个数。样例输入:120样例输出:5提示:注意:1不是N的质因数;若N为质数,N是N的质因数。#include<stdio.h>#in...
2018-02-14 20:19:48
230
原创 九度OJ 1047素数判定 解题报告
题目描述:给定一个数n,要求判断其是否为素数(0,1,负数都是非素数)。输入:测试数据有多组,每组输入一个数n。输出:对于每组输入,若是素数则输出yes,否则输入no。样例输入:13样例输出:yes解题思路:情况1:单独对2进行素数判定:。情况2:小于2和偶数也需要单独进行判定:注意:必须先对情况1进行判定之后在对情况2进行判定情况3:从3开始每次自增2,就是只对奇数进行判定#include<...
2018-02-14 15:07:19
253
原创 九度OJ 1163 素数解题报告
题目描述:输入一个整数n(2<=n<=10000),要求输出所有从1到这个整数之间(不包括1和这个整数)个位为1的素数,如果没有则输出-1。输入:输入有多组数据。每组一行,输入n。输出:输出所有从1到这个整数之间(不包括1和这个整数)个位为1的素数(素数之间用空格隔开,最后一个素数后面没有空格),如果没有则输出-1。样例输入:100样例输出:11 31 41 61 71解题思路:素数筛...
2018-02-14 14:29:51
216
原创 九度OJ 1040 Prime Number 解题报告
题目描述:Output the k-th prime number.输入:k≤10000输出:The k-th prime number.样例输入:37样例输出:517#include<stdio.h>#define MAX 10001int PrimeSize;//素数个数int Prime[MAX];//存素数int Mark[MAX];//标记素数//默认标记数组0...
2018-02-14 12:59:18
250
原创 九度OJPrime Numbe1040
#include<stdio.h>#define MAX 110001int mark[MAX]; //标记int prime[MAX]; //存素数int primeSize; //素数个数//2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 3...
2018-02-13 23:27:22
157
原创 九度OJ素数判定1047
/*给定一个数n,要求判断其是否为素数(0,1,负数都是非素数)。输入:测试数据有多组,每组输入一个数n。输出:对于每组输入,若是素数则输出yes,否则输入no。样例输入:13样例输出:yes*/#include<iostream>#include<cmath>using namespace std;bool Judge(int x){ i...
2018-02-13 18:45:50
191
原创 九度OJLeast Common Multiple 1439
/*23 5 7 156 4 10296 936 1287 792 110510296*/#include<stdio.h>int gcd(int a,int b){ return b==0?a:gcd(b,a%b);}int lcm(int a,int b){ return a*b/gcd(a,b);}int main(){ int T...
2018-02-13 18:44:36
295
原创 九度OJ1438最小公倍数
#include<stdio.h>int gcd(int a,int b){ while(b){ int t=a%b; a=b; b=t; } return a;}int lcm(int a,int b){ return a*b/gcd(a,b);}int main(){ int a,b; while(~scanf("%d%d",&a,&...
2018-02-13 11:38:12
211
原创 九度OJ1438最小公倍数
/*10 14样例输出:70*/#include<stdio.h>int gcd(int a,int b){//(14,49)(49,14)(14,7)(7,0) if(b==0) return a;//7 else return gcd(b,a%b);//(49,14)(14,7)(7,0)}int lcm(int a,int b){ ret...
2018-02-13 11:34:07
235
原创 九度OJ最大公约数1056
#include<stdio.h>int gcd(int a,int b){//(14,49)(49,14)(14,7) while(b){//b=49 b=14 b=7 b=0 int t=a%b;//t=14 t=7 t=0 a=b;//a=49 a=14 a=7 b=t;//b=14 b=7 b=0 } r...
2018-02-13 11:11:10
491
原创 九度OJ最大公约数1056
#include<stdio.h>int gcd(int a,int b){//(14,49)(49,14)(14,7) while(b){//b=49 b=14 b=7 b=0 int t=a%b;//t=14 t=7 t=0 a=b;//a=49 a=14 a=7 b=t;//b=14 b=7 b=0 } r...
2018-02-13 10:59:41
595
原创 九度OJ最大公约数1056
#include<stdio.h>int gcd(int a,int b){ if(b==0) return a; else return gcd(b,a%b);}int main(){ int a,b; while(~scanf("%d%d",&a,&b)) printf("%d\n",gcd(a,b)); ...
2018-02-13 10:33:40
515
原创 九度OJ八进制1194
/*输入一个整数,将其转换成八进制数输出。输入包括一个整数N(0<=N<=100000)。输出:可能有多组测试数据,对于每组数据, 输出N的八进制表示数。样例输入:78971011*/#include<stdio.h>int main(){ int i,num; while(~scanf("%d",&num)){ i=0; ...
2018-02-13 09:18:09
274
原创 九度OJ进制转换1138
/*一个长度最多为30位数字的十进制非负整数转换为二进制数输出。多组数据,每行为一个长度不超过30位的十进制非负整数。(注意是10进制数字的个数可能有30个,而非30bits的整数)输出:每行输出对应的二进制数。样例输入:0138样例输出:01111000*/#include<stdio.h>int main(){ long dig; int i,n...
2018-02-13 09:17:10
368
原创 九度OJ1118数制转换
/*求任意两个不同进制非负整数的转换(2进制~16进制),所给整数在long所能表达的范围之内。不同进制的表示符号为(0,1,...,9,a,b,...,f)或者(0,1,...,9,A,B,...,F)。输入只有一行,包含三个整数a,n,b。a表示其后的n 是a进制整数,b表示欲将a进制整数n转换成b进制整数。a,b是十进制整数,2 =< a,b <= 16。数据可能存在包含...
2018-02-12 23:12:25
220
原创 九度OJ1015还是A+B
#include<stdio.h>#include<string.h> int main(){ char A[20],B[20];//13240004231 42352 int k; while(~scanf("%s%s%d",A,B,&k)){ if(A[0]=='0'&&A[1]==0&&B[0]=='0'&...
2018-02-12 23:10:59
239
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人