谈资

Talk

604B BY Generous @ 2017-10-24 15:06:22 IN Problem 1001

import java.util.Scanner;
     public class Main {    
	    public static void main(String[] args) {
	        Scanner in = new Scanner(System.in);
	        int a[]=new int[in.nextInt()+3];
	        a[0]=1;
	        while(in.hasNextInt())
	        {
	        	a[a[0]]=in.nextInt();

	        	for(int k=1;k<a[0];k++)
	        	{
	        		if(a[a[0]]==a[k]&a[a.length-2]!=0)
	        			a[a.length-1]=a[k];
	        		    a[a.length-2]=1;
	        	}
	        	a[0]++;
	        	if(a[0]==a.length-2)
	        	{ System.out.println(a[a.length-1]);
	        	a[0]=1;
	        	}
	        }
	        }
	    }
Tips:本主题暂无回复。
登录OnlineJudge账号后可以发表和回复Talk~登录OnlineJudge
请点击右方按钮跳转至OnlineJudge登录页面。