1 #include 2 using namespace std; 3 4 5 int main() 6 { 7 int i=0,&r=i; 8 auto a=r; 9 10 const int ci=i,&cr=ci;...
分类:
其他好文 时间:
2015-04-13 20:35:42
阅读次数:
107
static void Main(string[] args) { while (true) { for (int i = 1; i <= 100; i++) { if (i%2==1) //遇到奇数就continue最后打出的都是偶数 { continue; } Console.Write(i+....
分类:
其他好文 时间:
2015-04-13 20:35:04
阅读次数:
104
一维数组定义:int[] myAr;一维数组申明及其初始化: 申明数组,并制定数组的长度: int[] myArr=new int[](5); 如果用花括号初始化数组,则 还可以 不指定数组的大小 ,因为编译器会自 动统计元素的个数 :int[] myArr=new int[]{4,7, ...
分类:
编程语言 时间:
2015-04-13 20:30:52
阅读次数:
129
数值型类型INT从-231到-231-1的整型数据,存储大小2个字节SMALLLINT从-32768到32767的整数数据,存储大小4个字节TINYINT0~255的整数类型,存储大小1个位DECIMAL([,q])十进制数,共p位,小数点后面q位FLOAT双字长浮点数字符型数据CHAR(n)长度为...
分类:
数据库 时间:
2015-04-13 20:30:49
阅读次数:
188
主要是应用了头文件中的strstr函数char * strstr(const char *s1, const char *s2);查找是否存在: 1 #include 2 #include 3 int main(void) 4 { 5 char str3[] = {"abcabcda...
分类:
其他好文 时间:
2015-04-13 20:27:35
阅读次数:
126
#include#includeusing namespace std;int main(void){ int pos1,pos2,pos3,offset,temp=1,count=0; string str="bcdcdcdcdcdcdbcdasfabababds"; ...
分类:
其他好文 时间:
2015-04-13 20:24:37
阅读次数:
96
直接用一个优先队列去模拟Huffman树的建立过程。每次取优先队列前两个数,然后累加其和,把这个和在放入到优先队列中去。 1 #include 2 #include 3 using namespace std; 4 5 int main() 6 { 7 int n; 8 whi...
分类:
其他好文 时间:
2015-04-13 20:22:15
阅读次数:
192
一、泛型入门:我们先来看一个最为常见的泛型类型List的定义(真正的定义比这个要复杂的多,我这里删掉了很多东西)[Serializable]public class List : IList, ICollection, IEnumerable{ public T this[int index]...
分类:
其他好文 时间:
2015-04-13 20:20:05
阅读次数:
126
思路:有点枚举的意思 基本的分支限界#include#includeusing namespace std;int a[11];char map[11][11];int n,k;int sum;void dfs(int t,int x)// 行号 需要放置的皇后数{ int i,j; i...
分类:
其他好文 时间:
2015-04-13 20:19:33
阅读次数:
118
2014年去某公司笔试的时候遇到这么一道题:public class Test { public static void main(String[] args) { Integer int1 = Integer.valueOf("100"); Integer int...
分类:
系统相关 时间:
2015-04-13 20:17:04
阅读次数:
201