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

why wa?help me!thanks!!sample data no problem.

Posted by chengning at 2006-07-29 18:52:50 on Problem 1226
#include<iostream>
#include<string>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(n-->0)
	{
		int i,m,M[1000],j=0;
		cin>>m;
		char ch[1000];
		for(i=0;i<m;i++)
		{
			cin>>ch;
			M[i]=strlen(ch);
		}
		for(i=1;i<m;i++)
		{
			if(M[j]<M[i])
				j=i;
		}
		cout<<j+1<<endl;
	}
	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