标签:class div string tab ble c int sp table t har
3 4 3 1 2 8 5 3 4 6 1 0 2 3
24
#include<iostream>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using
namespace std;
#define max(a,b) a>b?a:b
int main(int argc, char*
argv[])
{
int a[25][25],dp[25][25]={0};
int
n,m,i,j;
cin>>n>>m;
for(i=0;i<n;i++)
for(j=0;j<m;j++)
cin>>a[i][j];
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
dp[i][j]=max(dp[i-1][j]+a[i-1][j-1],dp[i][j-1]+a[i-1][j-1]);
cout<<dp[n][m]<<endl;
return 0;
}
标签:class div string tab ble c int sp table t har
原文地址:http://www.cnblogs.com/52Cyan/p/3697992.html