标签:style blog http io ar color os sp for
3 4 3 1 2 8 5 3 4 6 1 0 2 3
24
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int a[22][22]; int main() { int i,j,m,n; memset(a,0,sizeof(a)); scanf("%d %d",&n,&m); for(i=1;i<=n;i++) { for(j=1;j<=m;j++) scanf("%d",&a[i][j]); } for(i=1;i<=n;i++) { for(j=1;j<=m;j++) a[i][j]+=max(a[i-1][j],a[i][j-1]); } printf("%d\n",a[n][m]); return 0; }
标签:style blog http io ar color os sp for
原文地址:http://blog.csdn.net/hdd871532887/article/details/41332237