#include <iostream>#include <string>using namespace std;//主函数int main(){ int m,n; char *x,*y; int **b,**c; void LCSLength(int m,int n,char *y,char *x,int **c,int **b); void LCS(int i,int j,char *x,int**b); cout<<"请输入两个序列的长度:"<<endl; cin>>m>>n; x=new char[m]; y=new char[n]; cout<<"请输入两个序列:"<<endl;...
#include<iostream>using namespace std;int BinarySeach(int a[],int& x,int n){int left=0;int right=n-1;while(left<=right){int middle=(left+right)/2;if(x==a[middle])return middle;if(x>a[middle])left=middle+1;else right=middle-1;}return -1;}int main(){cout<<"请输入数字个数,小于50个:"<<endl;int n; while(cin...
1:#include<iostream>
using namespace std;
int main()
{ int i,j,k,n;
cout<<"请输入n的值:";
cin>>n;
for (i=1;i<=n;i++)
{
if (i<=n/2)
{
for (j=1;j<=n/2+1-i;j++)
cout<<" ";
for (k=1;k<=2*i-1;k++)
cout<<"*";
cout<<endl;
}
else
{
for (j=1;j<=i-n/2-1;j++)
cout<<" ";
for (k=1;k<=(2*(n...