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

为什么wrong answer 呢?大家帮忙看看

Posted by y10liuyi at 2010-08-21 09:48:37 on Problem 2371
#include<stdio.h>
#include<string.h>
main()
{
	long int i,n,k,j,t;
	long int data[100000],que[100],ans[100];
	char sep[5];
	scanf("%ld",&n);
	for(i=0;i<n;i++)
	{
		scanf("%ld",&data[i]);
	}
	scanf("%s",sep);
	if(strcmp(sep,"###")==0)
	{
		scanf("%ld",&k);
	    for(i=0;i<k;i++)
		{
		    scanf("%ld",&que[i]);
			t=que[i];
		    ans[i]=data[t-1];
		}
		for(i=0;i<k;i++)
			printf("%ld\n",ans[i]);
	}
}

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