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

哪错了??

Posted by bushiniao at 2006-11-04 16:10:52 on Problem 2452
#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:
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