Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
problem 1579 在编译软件下测试成功,但是出现PE,请问各位大侠是什么原因#include<iostream> using namespace std; #define Max 21 int main() { int array[Max][Max][Max]={0}; int temp[Max]={0},temp2[Max*3]={0}; int i,j,k,count=0,count2=0; for(i=0;i<21;i++) for(j=0;j<21;j++) { array[0][i][j]=1; array[i][0][j]=1; array[i][j][0]=1; } for(i=1;i<Max;i++) for(j=1;j<Max;j++) for(k=1;k<Max;k++) { if(i<j&&j<k) array[i][j][k]=array[i][j][k-1]+array[i][j-1][k-1]-array[i][j-1][k]; else array[i][j][k]=array[i-1][j][k]+array[i-1][j-1][k]+array[i-1][j][k-1]-array[i-1][j-1][k-1]; } int a,b,c; while(cin>>a>>b>>c) { if(a==-1&&b==-1&&c==-1) { for(i=0;i<count;i++) cout<<"w("<<temp2[3*i] <<","<<temp2[3*i+1]<<","<<temp2[3*i+2]<<") = "<<temp[i]<<endl; break; } if(a<=0||b<=0||c<=0) { temp[count++]=array[0][0][0]; temp2[count2++]=a; temp2[count2++]=b; temp2[count2++]=c; } else if(a>20||b>20||c>20) { temp[count++]=array[20][20][20]; temp2[count2++]=a; temp2[count2++]=b; temp2[count2++]=c; } else { temp[count++]=array[a][b][c]; temp2[count2++]=a; temp2[count2++]=b; temp2[count2++]=c; } } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator