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 |
麻烦帮我看下错在哪里~~本机上根本没错误啊#include <iostream> using namespace std; int main() { int n,m,i,k,j,c; int max=0; int *p; cin>>n; p=new int[n]; for(i=0;i<n;i++) { cin>>p[i]; } for(i=0;i<n;i++) { k=p[i]; c=1; for(j=i;j<n;j++) { c=1; k=p[i]; for(m=j+1;m<n;m++) { if(p[m]>k) { c++; k=p[m]; } } if(c>max) max=c; } } delete [] p; cout<<max<<endl; return 0; } 用的是递归,-_-!! 不知道哪里出错了,要注意数据范围吗 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator