This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
Scanner scn=new Scanner(System.in); | |
int n=Integer.parseInt(scn.nextLine()); | |
for(int i=1;i<=n;i++){ | |
String str[]=scn.nextLine().split(" "); | |
int num=str.length/2; | |
System.out.printf("Case %d: %s\n",i,str[num]); | |
} | |
} | |
/* | |
題目:Q11875 - Brick Game | |
作者:1010 | |
時間:西元 2016 年 9 月 */ | |
} |
這題就取中位數就好了