题目描述 有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛? Input 输入数据由多个测试实例组成,每个测试实例占一行,包括一个整数n(0<n<55),n的含义如题目中描述。n=0表示输入数据的结束,不做处理。 Out... ...
分类:
其他好文 时间:
2016-05-13 14:12:57
阅读次数:
142
在部署完成项目之后,遇到了使用SLF4J输出,但是catalina.out无输出的问题, 查找错误文件后,找到了这样一行错误 少包了,所以找到这个包 之后搞定~ ...
分类:
其他好文 时间:
2016-05-13 12:08:59
阅读次数:
279
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //设置响应文本类型 response.setContentTy ...
分类:
其他好文 时间:
2016-05-13 11:09:24
阅读次数:
129
一、服务端 1.编写webservice服务类, 使用@WebService注解 @WebServicepublic class BaseService { public void add(String value){ System.out.println("add: "+ value); } pu ...
分类:
Web程序 时间:
2016-05-13 08:14:47
阅读次数:
291
NumberFormat numberFormat=new DecimalFormat("#.00"); String percent=null; percent=numberFormat.format((float)num1/(float)num2*100); System.out.println ...
分类:
编程语言 时间:
2016-05-13 08:02:42
阅读次数:
171
匿名内部类使用,例:publicclassDemo{
publicstaticvoidmain(String[]args){
RichManrm=newRichMan();
rm.marry(newIWRB(){
@Override
publicvoidwhite(){
System.out.println("beauty");
}
@Override
publicvoidrich(){
System.out.println("rich");
}
@Override
publicvoidb..
分类:
其他好文 时间:
2016-05-13 05:18:01
阅读次数:
142
classTriangle2
{
publicstaticvoidmain(String[]args){
intx,y;
for(x=1;x<=5;x+=1){
for(y=1;y<=x+5;y+=1){
System.out.print("\t");
while(y==6-x){
System.out.print("*");
break;
}
}
//System.out.print("\t");
S..
分类:
其他好文 时间:
2016-05-13 05:11:25
阅读次数:
149
以代码为例publicclassHelloWorld{
publicstaticvoidmain(String[]args){
System.out.println("helloworld");
}
}编译之后,得到了HelloWorld.class然后让虚拟机器来执行这个HelloWorld。1.虚拟机会在classpath中找到HelloWorld.class。2.虚拟机中的解释器会把HelloWorld.class..
分类:
编程语言 时间:
2016-05-13 05:11:18
阅读次数:
152
classSumArray
{
publicstaticvoidmain(String[]args)
{
int[]arr=newint[100];
arr(arr);
Outarr(arr);
intb=sum(arr);
System.out.print("Sum"+"Arr["+arr.length+"]"+"="+b);
}
publicstaticint[]arr(int[]arr)
{
for(inti=0;i<arr.length;i+=1..
分类:
编程语言 时间:
2016-05-13 05:08:28
阅读次数:
152
#include<stdio.h>#include<string.h>#include<stdlib.h>intmain(intargc,char*argv[]){intch;FILE*in,*out;if(argc<3||argc>3){fprintf(stderr,"文件参数%s用法不正确",argv[1])exit(1);}if((in=fopen(argv[1],"r"))!=NULL){fprintf(stderr,"没有%s这..
分类:
其他好文 时间:
2016-05-13 04:44:54
阅读次数:
129