Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:数组太小,改之!

Posted by Pzjay at 2009-07-11 22:19:44 on Problem 1163
In Reply To:为什么RE... Posted by:cmonkey at 2009-07-05 23:34:19
> #include <iostream>
> using namespace std;
> int main()
> {   int n,a[100][100];
>     scanf("%d",&n);
>     for(int i=1;i<=n;i++)
>            for(int j=1;j<=i;j++)
>                     scanf("%d",&a[i][j]);
>     for(int i=n-1;i>0;i--)
>         for(int j=1;j<=i;j++)
>              if(a[i+1][j]>a[i+1][j+1])a[i][j]+=a[i+1][j];
>              else a[i][j]+=a[i+1][j+1];
>     printf("%d",a[1][1]); 
>     //system("PAUSE");
>     return 0;
> }
> 挺对的啊..

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator