摘要:
1、求一串字符串中连续出现次数最多的字串 #include#include#includeusing namespace std;pair fun(const string &str){ vector substrs; int maxcount=1,count=1; string substr; int i,len=str.length(); for(i... 阅读全文
摘要:
1、如在在word表格中打钩符号->其他符号->字体(wingdings2)2、循环右移方法1:#includevoid move(char *s) //循环右移1位{ if(s==NULL) return; char *p=s,*q=s; char tem... 阅读全文
摘要:
1、整型转化为字符串 整数+'0’隐性转化为char类型的数 void main(){ int aa=1; char t=1+'0'; printf("%d\n",t); printf("%c\n",t);} #includevoid main(){ int n=12345; int i=0; int j=0; char temp[6]... 阅读全文
摘要:
1、归并排序 2、内排序和外排序 外排序的一个例子是外归并排序(External merge sort),它读入一些能放在内存内的数据量,在内存中排序后输出为一个顺串(即是内部数据有序的临时文件),处理完所有的数据后再进行归并。比如,要对 900 MB 的数据进行排序,但机器上只有 100 MB 的可用内存时,外归并排序按如下方法操作: 读入 100 MB 的数据至内存中,用某种常... 阅读全文
摘要:
#include#includeusing namespace std;void ShellSort(int a[],int n){int d, i, j, temp;for(d=n/2;d>=1;d=d/2){for(i=d;i=0)&&(a[j]>temp);j=j-d){a[j+d]=a[j]... 阅读全文
摘要:
1、冒泡排序(自己写) #include#define swap(x,y) x=x+y; y=x-y; x=x-y;void maopao(int *a,int length) //每次把最大的元素冒泡到数组末尾,从小到大的顺序,length是数组长度,a是数组名,作为形参之后,数组名退化为指针{ int i=0; int j=1; int temp=0; fo... 阅读全文
摘要:
1、matlab画图x1=[1.00E-06,2.00E-06,4.00E-06,9.00E-06,2.00E-05,4.00E-05,8.00E-05,2.00E-04,4.00E-04,7.00E-04, 2.00E-03,4.00E-03];y1=[0.0735,0.073,0.068,... 阅读全文
摘要:
#include#includetypedef struct node { int data; struct node *lchild,*rchild;};node * create()//先序建立二叉树,根左右{ int x=0; node *t; printf(" input data:"); scanf("%d",&x); if(x==0) ... 阅读全文
摘要:
1、调整visio的画布大小按住Ctrl鼠标移动到画布边缘即可2、两个栈实现一个队列一个栈用于入队,一个用于出队#include#includeusing namespace std;templatestruct MyQueue{ void push(T &t) //入队操作,通过s1实... 阅读全文
摘要:
1、无法登陆TP-LINK路由器 原因是电脑的IP地址不是192.168.1.X; 设置电脑的无线连接的静态IP为192.168.1.2;登陆路由器即可 2、没有用malloc给q分配内存的错误提示 3、定义函数出现的错误 假如create函数要用到queue()函数:那么queue函数一定要定义在create函数之前.下面的情况会出错 queue *create... 阅读全文