1 #include<stdio.h>
 2 inline int max(int a,int b){
 3     if(a>b) return a;
 4     return b;
 5 }
 6 int main()
 7 {
 8     int n,m,i,j,c;
 9     int f[21][21]={0};
10     scanf("%d%d",&n,&m);
11     for(i=1;i<=n;i++)
12         for(j=1;j<=m;j++){
13             scanf("%d",&c);
14             f[i][j]=max(f[i-1][j],f[i][j-1])+c;
15         }
16     printf("%d\n",f[n][m]);
17     return 0;
18 } 

 

相关文章:

  • 2021-09-04
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2021-09-18
  • 2021-05-20
  • 2021-06-15
  • 2021-09-12
相关资源
相似解决方案