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=0; while(cin>>n) { int max=0; int *a=new int[n]; for(int i=0;i<n;i++) cin>>a[i]; for(i=0;i<n;i++) { int thisnum=0; for(int j=i;j<n;j++) { if(a[j+1]>a[j]) { thisnum++; } else { if(thisnum>max) max=thisnum; j=n; } } } if(max==0) max=-1; cout<<max<<endl; delete []a; } return 1; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator