您的位置:首页 > 编程语言 > Java开发

hdu2564 java

2016-02-19 15:47 387 查看
import java.util.Scanner;

public class P2564 {

public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
sc.nextLine();//过度
while(t-->0){
String str=sc.nextLine();
String result="";
if (str.charAt(0)!=' ') {
result += str.charAt(0);
}
for(int i=0;i<str.length()-1;i++){
if(str.charAt(i)==' '&&str.charAt(i+1)!=' '){//注意空格
result+=str.charAt(i+1);
}
}
result=result.toUpperCase();
System.out.println(result);
}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: