随笔分类 - Summary
摘要:1.点击计算机出现这个页面 2.解决方案运行 cmd (快捷键win + R)+ regedit 打开注册表 :[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Man...
阅读全文
摘要:1. NFS是一个使用RPC构造的客户端/服务器应用程序在Redhat6.5中的portmap包被其他的四个安装包所取代: libevent-1.4.13-4.el6.i686.rpmlibgssglue-0.1-11.el6.i686.rpmlibtirpc-0.2.1-5.el6.i686.rpmrpcbind-0.2.0-8.el6.i686.rpm因此大家可以通过Linux中规定的安装命令安装,上面的安装包,顺序就是上面的顺序2.安装完后,下面安装nfs服务包nfs-utils-1.2.3-39.el6.i686.rpm安装完后:启动(注意先启动rpcbind,再启动nfs)--原理.
阅读全文
摘要:/*当成员被静态修饰后,就多了一个调用的方式,除了被对象调用外,还可以被类名调用,类名,静态成员static 的特点1.随着类的加载而加载,也就是随着类的消失而消失,说明她的生命周期最长,2.优先于对象存在明确一点,静态是先存在,对象是后存在。3.被所有的对象所共享,4.可以直接被类名所调用实类变量和类变量的的区别1. 存放位置类变量随着类的加载存在于方法中实类变量随着对象的建立存在于堆内存中2.生命周期类变量的生命周期最长,随着类的消失而消失实类变量随着对象的消失而消失静态的使用注意事项1.静态的方法只能访问静态的成员和成员方法非静态既可以访问静态成员又可以非静态成员2.静态方法中不可以定义
阅读全文
摘要:用邻接矩阵存储有向图,并输出各个定点的出入度由于没有权值,两个定点之间的权值为1,没有注意memset(e,0,sizeof(e));我考试问题就在这。。。气炸了测试样例一: 1 input: 2 7 9 3 1 2 4 2 3 5 2 5 6 2 6 7 3 5 8 4 3 9 5 210 5 411 6 712 0 013 output14 1 3 1 1 2 1 015 0 2 2 1 2 1 1View Code 测试样例二: 1 input: 2 5 5 3 1 2 4 2 3 5 3 4 6 4 5 7 5 1 8 output: 9 1 1 1 1 110 1 1 1 1 1Vi
阅读全文
摘要:1 import java.util.Scanner; 2 3 /** 4 * @author Administrator 递归算法折半查找 5 */ 6 public class zhebanchazhao_1 { 7 8 public static void main(String[] args) { 9 10 int[] a = new int[100];11 int x;12 Scanner cin = new Scanner(System.in);13 14 x = cin.nextInt();15 ...
阅读全文
摘要:1 import java.util.Scanner; 2 3 /** 4 * @author Administrator 折半查找 5 */ 6 public class zhebansousuo { 7 8 public static void main(String[] args) { 9 int[] a = new int[100];10 int x, b;11 Scanner cin = new Scanner(System.in);12 x = cin.nextInt();13 14 ...
阅读全文
摘要:1 # include 2 # include 3 using namespace std; 4 void visit(int e) 5 { 6 printf("%d ",e); // 以整型格式输出 7 } 8 void mid(int treenode) 9 {10 if (treenode > 5)11 return;12 visit(treenode); /*访问treenode节点*/13 mid(treenode * 2);14 mid(treenode*2 + 1);15 }16 int main()17 {18 ...
阅读全文
摘要:1 # include 2 # include 3 using namespace std; 4 int main() 5 { 6 int m; 7 int tree[1111]; 8 cin>>m; 9 for(int i = 0; i m)19 flag = 1;20 else21 count = count*2;22 }23 else if(flag == 1)24 {25 if(count*2...
阅读全文
摘要:1 # include 2 # include 3 using namespace std; 4 int inorder(int i,int j) 5 { 6 if(i<=j) 7 printf("%d ",i); 8 if(2*i<=j) 9 inorder(2*i,j);10 if(2*i+1<=j)11 inorder(2*i+1,j);12 return 1;13 }14 int main()15 {16 inorder(1,5);17 }View Code
阅读全文
摘要:非递归算法对完全二叉树的前序遍历代码 1 # include 2 # include 3 using namespace std; 4 const int m = 100; 5 struct b 6 { 7 char data; 8 int num; 9 }se[m];10 int main()11 {12 stacks;13 int n;14 cin>>n;15 for(int i = 0;i >se[i].data;18 }19 se[0].num = 0;20 int root = se[0].num;21 ...
阅读全文
摘要:(1)第一个 1 # include 2 using namespace std; 3 struct student 4 { 5 int num; 6 char name[12]; 7 char sex; 8 int age; 9 }//stu[3] = {{1,"miao",'M',19},{2,"chuang",'F',23},{3,"hello",'M',24}};10 *st;11 struct student stu[3] = {{1,"miao",'
阅读全文
摘要:有一颗二叉树,最大深度为D,且所有叶子的深度都相同。所有结点从左到右从上到下的编号为1,2,3,·····,2的D次方减1。在结点1处放一个小猴 子,它会往下跑。每个内结点上都有一个开关,初始全部关闭,当每次有小猴子跑到一个开关上时,它的状态都会改变,当到达一个内结点时,如果开关关闭,小猴 子往左走,否则往右走,直到走到叶子结点。一些小猴子从结点1处开始往下跑,最后一个小猴儿会跑到哪里呢?输入输入二叉树叶子的深度D,和小猴子数目I,假设I不超过整棵树的叶子个数,D 1,则双亲为i / 2。2.若2i n,则i无左孩子。3.若2i + 1 n,则
阅读全文
摘要:1 # include 2 # include 3 # include 4 using namespace std; 5 int main(int argc,const char *argv[]) 6 { 7 /*-------------------------------------------*/ 8 //multiset中插入数据 9 //multisetms;10 //ms.insert("abc");11 // ms.insert("123");12 //ms.insert("111");13 //ms.insert(&q
阅读全文
摘要:1 # include 2 # include 3 # include 4 using namespace std; 5 struct myComp 6 { 7 bool operator()(const int &a, const int &b) 8 { 9 if(a!=b) 10 { 11 return a>b; 12 } 13 else 14 { 15 return a>b; 16 } 17 } 18 ...
阅读全文
摘要:1 # include 2 # include 3 # include 4 using namespace std; 5 struct myComp 6 { 7 bool operator()(const int &a,const int &b) 8 { 9 if(a!=b) 10 return a>b; 11 else 12 return as; 29 //s.insert(8); 30 //s.insert(1); 31 //s.insert(12);...
阅读全文
摘要:1 # include 2 # include 3 # include 4 # include 5 # include 6 # include 7 using namespace std; 8 int main(int argc,const char *argv[]) 9 { 10 /*------------------------------------------*/ 11 //length 12 //string s; 13 //s = "abc123456"; 14 //cout 21 //string s; 22 ...
阅读全文
摘要:1 # include 2 # include 3 # include 4 # include 5 using namespace std; 6 int main(int argc, const char * argv[]) 7 { 8 //vector容器的定义三种 9 //(1) vectorv 10 //(2) vectorv(3)用来存储3的double型的容器 11 //(3) vector(10,8.7)用来存储10个装有8.7的容器 12 13 //vectorv(3);//其中的3为元素的个数 14 /...
阅读全文
摘要:(1)for(int i = 0;i < n;i++)for中定义的 i 用完后就会释放,不会浪费内存(2)int y = 10; while(y < 10){ cout<<y<<endl; y--; }其中的y用完后还会在内存中占用内存
阅读全文
摘要:题意: A | B R | | | | B | E C / \ | / | \ | C D | H I J ...
阅读全文
摘要:题意:实验报告上有很多的数字,每个数字,出现偶数次,现在拿来三个数:x,y,z且有(x%4!=y%4)&&(y%4!=z%4)&&(x%4!=z%4)input第一行输入一个整数n,表示下面有n个整数接下来一行有n个整数output:输出三个数,(从小到大排列),俩俩数字之间用空格隔开Sample“111 1 2 2 3 3 4 4 3 2 1---------------------------------------------------------------------1 2 3第一种解法(Sort) 1 #include 2 #include 3 u
阅读全文

浙公网安备 33010602011771号