import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
StringBuffer sb = new StringBuffer("");
int num = Integer.parseInt(br.readLine());
String m="";
for (int i = 1; i < num+1; i++) {
int n=Integer.parseInt(br.readLine());
if(i>1)
sb.append("\n");
sb.append("Case ").append(i).append(":\n");
for (int j = 1; j < n+1; j++){
StringBuilder temp=new StringBuilder();
m=br.readLine();
boolean flag=false;
for(int z=0;z<m.length();z++){
if(m.charAt(z)==' '){
if(!flag){
temp.append(m.charAt(z));
flag=true;
}
}else{
flag=false;
temp.append(m.charAt(z));
}
}
sb.append(temp).append("\n");
}
}
System.out.print(sb);
}
}
No comments:
Post a Comment