//主程序class Program { static void Main(string[] args) { while (true) { Console.WriteLine("请录入动物名称...
分类:
其他好文 时间:
2015-05-29 22:57:36
阅读次数:
214
class G{ G(){ System.out.println("我是无参构造方法"); } G(String name){ System.out.println("我是有参构造方法,我的参数值是:"+name); } { S...
分类:
编程语言 时间:
2015-05-29 21:32:40
阅读次数:
122
串——数据结构的实现——定长存储顺序。
//头文件sstring.h
#pragma once
#include
using namespace std;
#define STRING_SIZE 20
typedef char Sstring[STRING_SIZE+1];
int length(Sstring S)
{
return strlen(S);
}
void StrAss...
分类:
其他好文 时间:
2015-05-29 20:26:59
阅读次数:
117
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
char a[200010];
int num[200010];
int main(){
gets(a);
int n;
scanf("%d",&n);
int len = strlen...
分类:
其他好文 时间:
2015-05-29 20:24:15
阅读次数:
122
Java遍历Set集合1、迭代器遍历: Set set = new HashSet(); Iterator it = set.iterator(); while (it.hasNext()) { String str = it.next(); System.out.pri...
分类:
编程语言 时间:
2015-05-29 20:10:38
阅读次数:
220
每个类只有一个析构函数和一个赋值函数,但可以有多个构造函数(包含一个拷贝构造函数,其它的称为普通构造函数)。class String { public: String(const char *str = NULL); // 普通构造函数 String...
分类:
其他好文 时间:
2015-05-29 20:06:16
阅读次数:
112
Android手机自带内部存储路径的获取 原文地址:http://my.oschina.net/liucundong/blog/288183直接贴代码: public static String getExternalSdCardPath() { if (SDCardUtils.isS...
分类:
移动开发 时间:
2015-05-29 20:01:33
阅读次数:
179
如何高效地进行数组复制?如果把一个变量值复制给另外一个数组变量,那么2个变量指向托管堆上同一个引用。如果想在托管堆上创建另外的一份数组实例,通常使用Array.Copy方法。class Program{static void Main(string[] args){int[] a = {1, 3, ...
分类:
编程语言 时间:
2015-05-29 19:48:27
阅读次数:
131
C#Dictionary字典说明必须包含名空间System.Collection.GenericDictionary里面的每一个元素都是一个键值对(由二个元素组成:键和值)键必须是唯一的,而值不需要唯一的键和值都可以是任何类型(比如:string,int,自定义类型,等等)通过一个键读取一个值的时间是接近O(1)键值对之间..
示例1:packagecom;
publicclassCar{
//属性
//汽车颜色
Stringcolor="红色";
//轮胎
intnum=4;
//运行的行为:成员方法
publicvoidrun(){
System.out.println(color+"----"+num);
System.out.println("我能在高速路上跑呢。。。你能吗...");
}
publicstaticvoidmain(String..
分类:
编程语言 时间:
2015-05-29 18:24:03
阅读次数:
209