摘要:
#include<stdio.h>int GetMaxs(int m,int n,int a[101][101]);int MaxSum(int n,int *a);int main(){ int n,a[101][101]; while(scanf("%d",&n)!=EOF){ for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) scanf("... 阅读全文
摘要:
#include<stdio.h>/* PKU2593给出一串数字使得其中两个子段和最大*/void MaxSum(int n,int m,int *a,int *b);int main(){ int a1[100002],a2[100002],n,b1[100002],b2[100002]; a1[0]=a2[0]=b1[0]=b2[0]=0; while(scanf("%d",&n),n){... 阅读全文
摘要:
有n个数 求 他的最大字段和! 1 /*一维最大字段和*/ 2 3 #include<stdio.h> 4 5 int MaxSum(int n,int *a); 6 7 int main(){ 8 int a[101],n; 9 while(scanf("%d",&n)!=EOF){10 for(int i=1;i<=n;i++)11 scanf("%d",a+i);12 printf("%d\n",MaxSum(n,a));13 }14 return 0;15 }16 17 int MaxSum(... 阅读全文
摘要:
#include<stdio.h>#include<string.h>void LCSLength(int m,int n,char *x,char *y,int c[502][502]);int main(){ char a[1002],b[1002]; while(scanf("%s%s",a,b)!=EOF){ int m=strlen(a); int n=strlen(b); int c[502][502]; LCSLength(m,n,a,b,c); printf("%d\n",c[m][n]); ... 阅读全文
摘要:
#include<stdio.h>#include<math.h> void GetParamater(int a[7][10],int n,int m,int sum0[7]);void GetSum(int data,int sum[10],int a[7][10]);int main(){ int a[7][10] ; int data,sum[10],sum0[7]; GetParamater(a,6,10,sum0); //printf("%lf\n",log10(92345)); while(scanf("%d",&a 阅读全文