• 关于

    i++

    的搜索结果

回答

#include #include using namespace std; char ** create_table(int rows, int cols){ char **a; a = new char *[rows+rows]; for(int i;i<rows+rows;i++){ a[i]=new char[cols+cols+1]; } return a; } char ** create_table2(char **a, int rows, int cols){ for(int i = 0; i< rows+rows; i++){ for(int x = 0; x< cols+cols+1; x++){ a[i][x] = ' '; } } for(int i = 1;i < rows+rows; i++){ for(int x = 0; x < cols+cols+1;x+=2){ a[i][x] = '|'; } } for(int i = 1;i < rows+rows; i+=2){ for(int x = 0; x < cols+cols+1;x++){ a[i][x] = '_'; } } return a; } int main(){ char **a; int rows = 2; int cols = 3; a = create_table(2, 3); a =create_table2(a, 2, 3); for(int i = 0; i < rows+rows; i++){ for (int b = 0;b < cols+cols+1; i++){ cout << a[i][b]; } } return 0; }

a123456678 2019-12-02 01:59:17 0 浏览量 回答数 0

问题

读取一个100+M的文件,读取时候手机运行内存超过了900M,如何能再给压缩压缩?

杨冬芳 2019-12-01 19:34:54 1066 浏览量 回答数 1

回答

using namespace std; char ** create_table(int rows, int cols){ char **a;a = new char *[rows+rows];for(int i;ia[i]=new char[cols+cols+1];} return a;} char create_table2(char a, int rows, int cols){ for(int i = 0; i< rows+rows; i++){ for(int x = 0; x< cols+cols+1; x++){ai = ' ';}}for(int i = 1;i < rows+rows; i++){ for(int x = 0; x < cols+cols+1;x+=2){ai = '|';}}for(int i = 1;i < rows+rows; i+=2){ for(int x = 0; x < cols+cols+1;x++){ai = '_';}} return a;}int main(){ char **a;int rows = 2;int cols = 3;a = create_table(2, 3);a =create_table2(a, 2, 3); for(int i = 0; i < rows+rows; i++){ for (int b = 0;b < cols+cols+1; i++){ cout << a[i][b]; }}return 0;}

nothingfinal 2019-12-02 01:59:17 0 浏览量 回答数 0

阿里云试用中心,为您提供0门槛上云实践机会!

0元试用32+款产品,最高免费12个月!拨打95187-1,咨询专业上云建议!

回答

using namespace std; char ** create_table(int rows, int cols){ char **a;a = new char *[rows+rows];for(int i;ia[i]=new char[cols+cols+1];} return a;} char create_table2(char a, int rows, int cols){ for(int i = 0; i< rows+rows; i++){ for(int x = 0; x< cols+cols+1; x++){ a[i][x] = ' '; } }for(int i = 1;i < rows+rows; i++){ for(int x = 0; x < cols+cols+1;x+=2){ a[i][x] = '|'; } }for(int i = 1;i < rows+rows; i+=2){ for(int x = 0; x < cols+cols+1;x++){ a[i][x] = '_'; } } return a;}int main(){ char **a;int rows = 2;int cols = 3;a = create_table(2, 3);a =create_table2(a, 2, 3); for(int i = 0; i < rows+rows; i++){ for (int b = 0;b < cols+cols+1; i++){ cout << a[i][b]; } }return 0;}

xumaojun 2019-12-02 01:59:17 0 浏览量 回答数 0

回答

#include<stdio.h> void main(){ int a[100][100]={0}; int n,i,j,k = 0; scanf("%d",&n); for(i = 1;i<=n/2;i++){ for(j = i;j<=n-i;j++) a[j][i] = k++; for(j = i;j<=n-i;j++) a[n-i+1][j] = k++; for(j = n-i+1;j>=i+1;j--) a[j][n-i+1]=k++; for(j = n-i+1;j>=i+1;j--)//修改为 j=n-i+1 a[i][j] = k++; } for(i=1;i<=n;i++){ for(j = 1 ;j<=n;j++ ) printf("%2d ",a[i][j]); //修改为 %2d printf("\n"); } }

a123456678 2019-12-02 02:18:09 0 浏览量 回答数 0

回答

int index = 3; while(index++ < 5); //index++这个运算符表示的意思是整个表达式执行完毕,才加1 index = 3 index++ < 5 第一次 index = 3 index < 5 执行完毕之后 index = 4index = 4 index++ < 5 第二次 index = 4 index < 5 执行完毕之后 index = 5最后说明一下,++i 与 i++的区别就是 ++i表示整个表达式计算之前就加1,i++则是相反。可以这样记住,++i就是先加后用,i++就是先用后加。

杨冬芳 2019-12-02 02:27:28 0 浏览量 回答数 0

回答

var table = " "; table += ""; for (var i = 0; i < date.length; i++) { table += ""; } table += ""; for (var j = 0; j < department.length; j++) { table += ""; table += ""; for (var n = 0; n < date.length; n++) { table += ""; } } table += ""; table += " " + "" + " " + date[i] + " " + department[j] + " " + SeriesStr[0].data[n] + " "; $("#Exceltable").html(table);

小旋风柴进 2019-12-02 02:07:36 0 浏览量 回答数 0

问题

输出一个和螺旋数组如下

a123456678 2019-12-01 19:23:19 757 浏览量 回答数 1

回答

看你怎么输入的,假设是依次输完第一个学生的成绩,然后输入第二个,这样输入的,代码如下 Scanner reader=new Scanner(System.in); int[] scores = new scores[40]; for (int i = 0; i < 40; i++) { scores[i] = scanner.nextInt(); } double avg; for (int i = 0; i < 4; i++) { avg=0.0; for (int j = 0; j < 10; j++) { avg+=score[j*4+i]; } avg/=10.0; System.out.println("第" + (i+1) + "门课的平均成绩" + avg); } for (int i = 0; i < 10; i++) { avg=0.0; for (int j = 0; j < 4; j++) { avg+=score[i * 4 + j]; } avg/=4; System.out.println("第" + (i+1) + "个学生的平均成绩" + avg); }

蛮大人123 2019-12-02 02:38:06 0 浏览量 回答数 0

问题

java中运算中的变量是不是变量本身?

蛮大人123 2019-12-01 19:58:15 1082 浏览量 回答数 2

回答

void find3(int * ID, int n) { int candidate[3]; int nTimes[3] = {0}; int i; for (i = 0; i < n; i++) { if(nTimes[0] == 0) { if(ID[i] == candidate[1]) nTimes[1]++; else if (ID[i] == candidate[2]) nTimes[2]++; else { candidate[0] = ID[i]; nTimes[0]++; } } else if (nTimes[1] == 0) { if(ID[i] == candidate[0]) nTimes[0]++; else if (ID[i] == candidate[2]) nTimes[2]++; else { candidate[1] = ID[i]; nTimes[1]++; } } else if (nTimes[2] == 0) { if(ID[i] == candidate[0]) nTimes[0]++; else if (ID[i] == candidate[1]) nTimes[1]++; else { candidate[2] = ID[i]; nTimes[2]++; } } else { if(ID[i] == candidate[0]) nTimes[0]++; else if(ID[i] == candidate[1]) nTimes[1]++; else if(ID[i] == candidate[2]) nTimes[2]++; else nTimes[0]--, nTimes[1]--, nTimes[2]--; } } printf("三个水王ID分别是:%d,%d,%d\n", candidate[0], candidate[1], candidate[2]); }

a123456678 2019-12-02 02:41:23 0 浏览量 回答数 0

回答

includeinclude using namespace std;int main(){ int i,j,k; int nWidth,nHeight,nThird; cin>>nThird>>nHeight>>nWidth; /声明一个三维数组/int *grayScale = new int [nThird]; for (i = 0;i < nThird;i++) { grayScale[i] = new int*[nHeight]; for (j = 0;j < nHeight;j++) { grayScale[i][j] = new int [nWidth]; } } /将数组元素都赋值为1/for (k = 0;k < nThird;k++) { for (j = 0;j < nHeight;j++) { for (i = 0;i < nWidth;i++) { grayScale[k][j][i] = 1; } } } /打印数组元素/cout<for (k = 0;k < nThird;k++) { for (j = 0;j < nHeight;j++) { for (i = 0;i < nWidth;i++) { cout<<grayScale[k][j][i]<<setw(5); } cout<<endl; } cout<<endl; }/释放内存/for (j = 0;j < nThird;j++) { for (i = 0;i < nHeight;i++) { delete []grayScale[j][i]; } } delete []grayScale; return 0;} using namespace std;int main(){ int i,j,k; int nWidth,nHeight,nThird; cin>>nThird>>nHeight>>nWidth; /声明一个三维数组/int *grayScale = new int [nThird]; for (i = 0;i < nThird;i++) { grayScale[i] = new int*[nHeight]; for (j = 0;j < nHeight;j++) { grayScale[i][j] = new int [nWidth]; } } /将数组元素都赋值为1/for (k = 0;k < nThird;k++) { for (j = 0;j < nHeight;j++) { for (i = 0;i < nWidth;i++) { grayScale[k][j][i] = 1; } } } /打印数组元素/cout{ for (j = 0;j < nHeight;j++) { for (i = 0;i < nWidth;i++) { cout<<grayScale[k][j][i]<<setw(5); } cout<<endl; } cout<}/释放内存/for (j = 0;j < nThird;j++) { for (i = 0;i < nHeight;i++) { delete []grayScale[j][i]; } } delete []grayScale; return 0;}

nothingfinal 2019-12-02 02:00:02 0 浏览量 回答数 0

回答

canner reader=new Scanner(System.in); int[] scores = new scores[16]; for (int i = 0; i < 16; i++) { scores[i] = scanner.nextInt(); } int min = 0; for (int i = 0; i < 16; i++) { if (scores[i] <scores[min]) min = i; } System.out.printf("最小值" + score[min] + " " + min / 4 + "," + min % 4); int sum1 = 0; int sum2 = 0; for (int i = 0; i < 4; i++) { sum1 += scores[i * 5]; sum2 += scores[i * 3 + 3]; } System.out.printf("sum1=" + sum1 + " sum2=" + sum2);

蛮大人123 2019-12-02 02:38:16 0 浏览量 回答数 0

回答

方法一:冒泡法 #include<stdio.h> int main() { int a[10],i,j,temp; printf("please enter 10 number\n"); for(i=0;i<10;i++) scanf("%d",&a[i]); for(i=0;i<10;i++) { for(j=0;j<9-i;j++) if(a[j]>a[j+1]) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } for(i=0;i<10;i++) {printf("%d",a[i]); printf("\n");} return 0; } 方法二:选择法 #include<stdio.h> int main() { int i,j,min,a[10],temp; printf("please enter 10 number\n"); for(i=0;i<10;i++) scanf("%d",&a[i]); for(i=0;i<10;i++) {min=i; for(j=i+1;j<10;j++) if(a[min]>a[j]) min=j; temp=a[i]; a[i]=a[min]; a[min]=temp; } for(i=0;i<10;i++) {printf("%d",a[i]); printf("\n"); } return 0; }-------------------------int a[10],i,j,k,temp; 选择法: for(i=0;i<9;i++) { k=i; for(j=k+1;j<10;j++) if(a[k]<a[j]) k=j; temp=a[i];a[i]=a[k];a[k]=temp; } 冒泡法: for(i=0;i<9;i++) for(j=0;j<9-i;j++) if(a[j]>a[j+1]) { temp=a[j];a[j]=a[j+1];a[j+1]=temp; }

liujae 2019-12-02 01:18:14 0 浏览量 回答数 0

问题

实用jquery实现动态拼装json数组中的内容拼装table

杨冬芳 2019-12-01 20:17:57 1426 浏览量 回答数 1

问题

请教一下魔方阵的问题。。

a123456678 2019-12-01 19:22:44 1169 浏览量 回答数 1

问题

java遍历list问题

蛮大人123 2019-12-01 20:13:41 849 浏览量 回答数 2

回答

#include <stdio.h> #include <stdlib.h> #include <time.h>#define KeyType int #define InfoType chartypedef struct { KeyType key; //关键字项 InfoType otherdata; //其它数据项 } RecordType;void Merge2(RecordType *r,int s,int m,int t) { int i; int j=m+1, k; int l; RecordType a[11]; for (i=1; i<=t; i++) a[i]=r[i]; k=s; i=s; while (i<=m && j<=t) { if (r[i].key<=r[j].key) a[k]=r[i++]; else a[k]=r[j++]; ++k; } for ( l=i; l<=m; ++l) a[k++]=r[l]; for (l=j; l<=t; ++l) a[k++]=r[l]; for (i=1; i<=t; i++) r[i]=a[i]; }void MergeSort(RecordType *r,int s,int t) { int m=(s+t)/2; if (s>=t) return; MergeSort(r,s,m); MergeSort(r,m+1,t); Merge2(r,s,m,t); } //时间复杂度为O(logn) void main() { RecordType record[11]; int i; record[0].key=0; srand( (unsigned)time( NULL ) ); for( i=1;i<=10;i++) record[i].key = rand(); for(i=1;i<=10;i++) printf("%d ",record[i].key); printf("\n"); // for (i=0;i<10;i++) // printf("%d ",a[i]); MergeSort(record,1,10); for(i=1;i<=10;i++) printf("%d ",record[i].key); printf("\n"); }

知与谁同 2019-12-02 01:19:15 0 浏览量 回答数 0

回答

#include<stdio.h> #include<stdlib.h> #include<time.h> int b[ 10 ];void Merge( int c[], int d[], int l, int m, int r ) { int i = l, j = m + 1, k = l; while( ( i <= m ) && ( j <= r ) ) if( c[ i ] <= c[ j ] ) d[ k++ ] = c[ i++ ]; else d[ k++ ] = c[ j++ ]; if( i > m ) for( int q = j; q <= r; q++ ) d[ k++ ] = c[ q ]; else for( int q = i; q <= m; q++ ) d[ k++ ] = c[ q ]; }void Copy( int c[], int d[], int n1, int n2 ) { for( int i = n1; i <= n2; i++ ) c[ i ] = d[ i ]; }void MergeSort( int a[], int left, int right ) { if( left < right ) { int i = ( left + right ) / 2; //取中点,分成两路 MergeSort( a, left, i ); MergeSort( a, i + 1, right ); Merge( a, b, left, i, right ); //合并到数组b Copy( a, b, left, right ); //复制到数组a } }int main() { int a[ 10 ], i; srand( time( 0 ) ); for( i = 0; i < 10; i++ ) a[ i ] = rand() % 100; //随机生成 for( i = 0; i < 10; i++ ) //输出随机生成的数据 printf( "%d\t", a[ i ] ); printf( "\n" ); MergeSort( a, 0, 9 ); for( i = 0; i < 10; i++ ) //输出排序后的结果 printf( "%d\t", a[ i ] ); printf( "\n" ); return 0; } //在vc++6.0上调试运行成功。若有不明白的地方,call me!!!

美人迟暮 2019-12-02 01:19:15 0 浏览量 回答数 0

回答

/* 计算前N项大数阶乘和的递归实现 */ /* 大数用一般整型存储会造成数据溢出,产生错误,需用数组保存 */ #include <stdio.h> #include <string.h> // 计算大数的阶乘 void fac(int b, char *result) { if (1 == b) return; char *p = result; int t, m=0; while(*p) { t = (*p - '0') * b + m; *p++ = t % 10 + '0'; m = t / 10; } while (m) { *p++ = m % 10 + '0'; m /= 10; } *p = '\0'; fac(b-1, result); } // 大数求和 void big_sum(char *sum, char *num) { int m = 0, t = 0; while (*sum && *num) { t = *sum + *num - 2 * '0' + m; *sum = t % 10 + '0'; m = t / 10; ++sum; ++num; } char *p = *sum > *num ? sum : NULL, *q = sum; if (!p) while(*sum++ = *num++); p = q; while (*p) { t = *p - '0' + m; *p++ = t % 10 + '0'; m = t / 10; } while (m) { *p++ = m % 10 + '0'; m /= 10; } *p = '\0'; } // 初始化保存结果的数组 void Init_R(char *result) { int i = 0; while (*result) *result++ = (i++ == 0) ? '1' : 0; } const int SIZE = 20; // 前n项的大小 const int MAXSIZE = 1000; // 最大阶乘结果位 const int INC = MAXSIZE / 10; // 求和结果位增量 int main() { char r[MAXSIZE] = {'1'}; char sum[MAXSIZE + INC] = { 0 }; // 计算前N项阶乘和 for (int i = 1; i <= SIZE; ++i) { fac(i, r); big_sum(sum, r); Init_R(r); } // 打印字符串"1+2+...+n=" for (int i = 1; i <= SIZE; ++i) printf("%s%d!", i == 1 ? "" : "+", i); printf("=\n"); // 逆序从高位开始输出最后求和结果 int index = strlen(sum); while (index--) printf("%c", sum[index]); printf("\n"); return 0; }

寒凝雪 2019-12-02 01:24:16 0 浏览量 回答数 0

问题

关于越界的问题

蛮大人123 2019-12-01 19:35:52 1025 浏览量 回答数 1

回答

public static String foo(String s, String find) { String arr[] = s.split("\\."); for (int i = 1; i < arr.length - 1; i++) { int pos =arr[i].indexOf(find); if ( pos != -1) arr[i] = arr[i].substring(0,pos) + (char)(arr[i].charAt(pos)+32)+arr[i].substring(pos+1); if(pos == 0){ return arr[i] + "." + arr[i + 1]; } return arr[i - 1] + "." + arr[i] + "." + arr[i + 1]; } return ""; }

蛮大人123 2019-12-02 02:16:23 0 浏览量 回答数 0

回答

#include <iostream> using namespace std; int partition(int *a, int l, int h) { int x = a[l]; int i = l; int j = h+1; int temp; while (i<j) { while (a[++i]<x&&i<h); while(a[--j]>x); if (i<j) { temp = a[i]; a[i] = a[j]; a[j] = temp; } } a[l] = a[j]; a[j] = x; return j; } void qsort(int *a, int l, int h) { if (l>=h) return; int *s = new int[h-l+1]; int p = 0; s[p++] = l; s[p++] = h; int low,high,q; while (p>0) { high = s[--p]; low = s[--p]; if (low>=high) break; q = partition(a, low, high); if (q-low > high-q) { s[p++] = low; s[p++] = q-1; if (high > q) { s[p++] = q+1; s[p++] = high; } } else { s[p++] = q+1; s[p++] = high; if (q > low) { s[p++] = low; s[p++] = q-1; } } } delete []s; } int main() { int a[9] = {9,8,7,6,5,4,3,2,1}; //int a[9] = {1,2,3,4,5,6,7,8,9}; qsort(a,0,8); for (int i=0; i<9; i++) cout<<a[i]<<endl; return 0; }

知与谁同 2019-12-02 01:24:53 0 浏览量 回答数 0

回答

public class Quine { public static void main(String[] args) { char q = 34; // Quotation mark character String[] l = { // Array of source code "public class Quine", "{", " public static void main(String[] args)", " {", " char q = 34; // Quotation mark character", " String[] l = { // Array of source code", " ", " };", " for(int i = 0; i < 6; i++) // Print opening code", " System.out.println(l[i]);", " for(int i = 0; i < l.length; i++) // Print string array", " System.out.println(l[6] + q + l[i] + q + ',');", " for(int i = 7; i < l.length; i++) // Print this code", " System.out.println(l[i]);", " }", "}", }; for(int i = 0; i < 6; i++) // Print opening code System.out.println(l[i]); for(int i = 0; i < l.length; i++) // Print string array System.out.println(l[6] + q + l[i] + q + ','); for(int i = 7; i < l.length; i++) // Print this code System.out.println(l[i]); } }

蛮大人123 2019-12-02 02:00:31 0 浏览量 回答数 0

问题

javascript 怎样把拼接起来的<tr><td></td></tr>插入到一个table,

小旋风柴进 2019-12-01 20:23:00 2749 浏览量 回答数 1

问题

一个网页外链了两个js文件却不能同时生效?

a123456678 2019-12-01 20:20:40 1649 浏览量 回答数 1

回答

void Add(char a[],char b[],char d[]) { char c[10001]; int lena=strlen(a),lenb=strlen(b); int i,j,len; len=lena>lenb?lena:lenb; len++; c[0]='\0'; for(i=1;i<=len;i++)c[i]='0'; for(i=1;i<=lena;i++)c[i]+=a[lena-i]-48; for(i=1;i<=lenb;i++)c[i]+=b[lenb-i]-48; for(i=0;i<=len;i++) if(c[i]>57) { c[i]-=10; c[i+1]++; } for(i=len;i>1;i--) if(c[i]==48)len--; else break; for(i=0;i<=len;i++) d[i]=c[len-i]; } char c[120]; Add(a,b,c); printf("%s", c);

51干警网 2019-12-02 01:35:02 0 浏览量 回答数 0

回答

很基础的排序,C++版:(键盘输入输出) #include <iostream> using namespace std; int sort(int n) { int i,j,temp; for (i=1;i<n;i++) for (j=0;j<n-i;j++) if (a[j]>a[j+1]) {temp=a[j];a[j]=a[j+1];a[j+1]=temp;} } int main(void) { int i,n; cin>>n; int *a=new int[n]; for (i=0;i<n;i++) cin>>a[i]; sort(n); for (i=0;i<n;i++) cout<<a[i]<<" "; return 0; } 再来一个C语言版: #include <stdio.h> int sort(int n) { int i,j,temp; for (i=1;i<n;i++) for (j=0;j<n-i;j++) if (a[j]>a[j+1]) {temp=a[j];a[j]=a[j+1];a[j+1]=temp;} } int main(void) { int i,n; scanf("%d",&n); int *a=new int[n]; for (i=0;i<n;i++) scanf("%d",&n); sort(n); for (i=0;i<n;i++) printf("%d ",a[i]); return 0; }

聚小编 2019-12-02 01:17:29 0 浏览量 回答数 0

回答

using namespace std;int main(){ int i,j,k; int nWidth,nHeight,nThird; cin>>nThird>>nHeight>>nWidth; /声明一个三维数组/int *grayScale = new int [nThird]; for (i = 0;i < nThird;i++) { grayScale[i] = new int*[nHeight]; for (j = 0;j < nHeight;j++) { grayScale[i][j] = new int [nWidth]; } } /将数组元素都赋值为1/for (k = 0;k < nThird;k++) { for (j = 0;j < nHeight;j++) { for (i = 0;i < nWidth;i++) { grayScale[k][j][i] = 1; } } } /打印数组元素/cout<for (k = 0;k < nThird;k++) { for (j = 0;j < nHeight;j++) { for (i = 0;i < nWidth;i++) { cout<<grayScale[k][j][i]<<setw(5); } cout<<endl; } cout<<endl; }/释放内存/for (j = 0;j < nThird;j++) { for (i = 0;i < nHeight;i++) { delete []grayScale[j][i]; } } delete []grayScale; return 0;}

xumaojun 2019-12-02 02:00:02 0 浏览量 回答数 0

回答

这个问题我只能想出O(nk)的算法,写完之后直接去交,遇到了跟题主一样的问题,然后查了下其他题目的代码,发现要将returnSize赋值成那个数组的大小。。。下面上代码: int* calc(int* nums,int n,int k,int *rec[10],int *head,int *tail) { if (k == 0) return NULL; int *cur = (int *)malloc(k*sizeof(int)); for (int i = 0; i<10; i++) { head[i] = tail[i] = 0; } int curSize = 0; for(int i = 0; i<n - k; i++) { int u = nums[i]; rec[u][tail[u]++] = i; } for (int i = 0, last = 0; i<k; i++) { int u = nums[i + n - k]; rec[u][tail[u]++] = i + n - k; for (int j = 9; j >= 0; j--) { if (head[j] != tail[j]) { cur[curSize++] = j; int end = rec[j][head[j]]; while (last <= end) { int u = nums[last++]; head[u]++; } break; } } } return cur; } int* maxNumber(int* nums1, int nums1Size, int* nums2, int nums2Size, int k, int* returnSize) { int n = nums1Size>nums2Size ? nums1Size : nums2Size; int *ans=NULL,*rec[10], head[10], tail[10]; for (int i = 0; i < 10; i++) { rec[i] = (int*)malloc(n*sizeof(int)); } for (int k1 = 0; k1 <= k&&k1 <= nums1Size; k1++) { int k2 = k - k1; if (k2>nums2Size) continue; int *cur1 = calc(nums1, nums1Size, k1, rec, head, tail), *cur2 = calc(nums2, nums2Size, k2, rec, head, tail), *curans = (int*)malloc(k*sizeof(int)), flag = 1,flag1=1; for (int i = 0, j1 = 0, j2 = 0; i < k; i++) { if (j1 < k1&&j2 < k2) { int f = 1; for (int u1 = j1, u2 = j2; u1 < k1&&u2 < k2; u1++, u2++) { if (cur1[u1]>cur2[u2]) { curans[i] = cur1[j1++]; f = 0; break; } else if (cur1[u1] < cur2[u2]) { curans[i] = cur2[j2++]; f = 0; break; } } if (f) { if (k1 - j1>k2 - j2) curans[i] = cur2[j2++]; else curans[i] = cur1[j1++]; } } else if (j1 < k1) { curans[i] = cur1[j1++]; } else { curans[i] = cur2[j2++]; } if (flag1&&ans!=NULL) { if (curans[i] < ans[i]) { flag = 0; break; } else if (curans[i]>ans[i]) { flag1 = 0; } } } if (flag) { free(ans); ans = curans; } else { free(curans); } } *returnSize = k; return ans; }

a123456678 2019-12-02 02:42:18 0 浏览量 回答数 0
阿里云大学 云服务器ECS com域名 网站域名whois查询 开发者平台 小程序定制 小程序开发 国内短信套餐包 开发者技术与产品 云数据库 图像识别 开发者问答 阿里云建站 阿里云备案 云市场 万网 阿里云帮助文档 免费套餐 开发者工具 企业信息查询 小程序开发制作 视频内容分析 企业网站制作 视频集锦 代理记账服务 2020阿里巴巴研发效能峰会 企业建站模板 云效成长地图 高端建站