03 2015 档案
摘要:用类名定义一个变量的时候,定义的应该只是一个引用,外面可以通过这个引用来访问这个类里面的属性和方法,那们类里面是够也应该有一个引用来访问自己的属性和方法纳?呵呵,JAVA提供了一个很好的东西,就是 this 对象,它可以在类里面来引用这个类的属性和方法。先来个简单的例子: 1 public clas...
阅读全文
摘要:#include#include#include#includeusing namespace std;char a[210];int main(){ while(scanf("%s",a)!=EOF) { int len = strlen(a); sort(...
阅读全文
摘要:转载:http://wenku.baidu.com/link?url=M6cImkiMWljOCMyxjH7cDvpxQwhGobTM4ylnqnLQ6D0XwOkLgg-Qj_45Zd4_5aVpv1VNyJctBaPlPC85wPoyNrKlzSVRmkg162JhzdBu2zK
阅读全文
摘要:1. 普通类继承,并非一定要重写父类方法。2. 抽象类继承,如果子类也是一个抽象类,并不要求一定重写父类方法。如果子类不是抽象类,则要求子类一定要实现父类中的抽象方法。3. 接口类继承。如果是一个子接口,可以扩展父接口的方法;如果是一个子抽象类,可以部分或全部实现父接口的方法;如果子类不是抽象类,则...
阅读全文
摘要:转型是在继承的基础上而言的,继承是面向对象语言中,代码复用的一种机制,通过继承,子类可以复用父类的功能,如果父类不能满足当前子类的需求,则子类可以重写父类中的方法来加以扩展。向上转型:子类引用的对象转换为父类类型称为向上转型。通俗地说就是是将子类对象转为父类对象。此处父类对象可以是接口向下转型:父类...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #define sc(x) scanf("%d",&x) 7 #define pf(x) printf("%d\n",x) 8 #define P printf("\n") ...
阅读全文
摘要:转载http://blog.csdn.net/sjf0115/article/details/8579935在ZOJ 1085Alien Security中
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #define sc(x) scanf("%d",&x) 6 #define CL(x, y) memset(x,y,sizeof(x)) 7 using namespace std; 8 cons...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #define M 21 5 #define sc(x) scanf("%d",&x) 6 #define pf(x) printf("%d\n",x) 7 #define PF(x) printf("%d ",x) 8 #de...
阅读全文
摘要:1 import static java.lang.System.out; 2 import java.math.BigInteger; 3 import java.util.Scanner; 4 5 public class Main { 6 7 public static void...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #define sc(x) scanf("%d",&x) 6 #define pf(x) printf("%d\n",x) 7 #define CL(x,y) memset(x,y,sizeof(x...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #define CL(x, y) memset(x, y, sizeof(x)) 6 using namespace std; 7 const int MAX = 5; 8 int N, i, j,...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #define CL(x, y) memset(x,y,sizeof(x)) 6 using namespace std; 7 const int MAX = 33; 8 int A...
阅读全文
摘要:#include #include #include #include #define CL(x, y) memset(x,y,sizeof(x))using namespace std;const int MAX = 55;int N, T, A, B, C, i, j, k;int used[M...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #define CL(x,y) memset(x,y,sizeof(x)) 6 using namespace std; 7 struct node 8 { 9 int x...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #define CL(x, y) memset(x, y, sizeof(x)) 6 using namespace std; 7 const int MAX = 28; 8 int N, a, b...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #define CL(x, y) memset(x,y,sizeof(x)) 6 using namespace std; 7 const int MAX = 200005;//100005太小了?...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define sc(x) scanf("%d",&(x)) 8 #define pf(x) printf("%d\n", x) 9 #define ...
阅读全文
摘要:注意结构体队列的使用,在队列中,一条完整的路径才是正确的,中间的歧路最后还是走不通转载:http://blog.csdn.net/yulanarti/article/details/1787971 ——> 说明sprintf()的作用注意 sprintf(num, "%d", cur.num);//...
阅读全文
摘要:转载:http://www.cnblogs.com/nerxious/archive/2013/01/25/2876489.html匿名内部类也就是没有名字的内部类正因为没有名字,所以匿名内部类只能使用一次,它通常用来简化代码编写但使用匿名内部类还有个前提条件:必须继承一个父类或实现一个接口
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #define sc(x,y) scanf("%d %d",&(x),&(y)) 6 #define pf(x) printf("%d\n", x) 7 using namespace std; 8...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #define CL(x, y) memset(x, y, sizeof(x)) 5 using namespace std; 6 const int INF = 1 >ch) 18 { 19 ...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 char maze[8][8]; 7 int n, m, t; 8 int mx, my, X, Y; 9 int flag, tt;10 int Move[4][2]= {...
阅读全文
摘要:1 #include 2 #include 3 #define pf(x) printf("%d\n", x) 4 using namespace std; 5 const int MAX = 105; 6 char oil[MAX][MAX]; 7 int Move[8][2]= {{1,0...
阅读全文
摘要:装载:http://blog.csdn.net/maggiedorami/article/details/7944459java提供了一组基本数据类型,包括boolean, byte, char, short, int, long, float, double. 同时,java也提供了这些类型的封装...
阅读全文

浙公网安备 33010602011771号