HDOJ 2562 奇偶位互换(水)

来源:互联网 发布:linux 查看ssh 编辑:程序博客网 时间:2024/06/06 23:54

HDACM 2562

import java.util.Scanner;public class Main {    public static void main(String[] args) {        Scanner sc = new Scanner(System.in);        while (sc.hasNext()) {            int c = sc.nextInt();            while (c-- > 0) {                String str = sc.next();                for (int i = 1; i < str.length(); i+= 2) {                    System.out.print(str.charAt(i));                    System.out.print(str.charAt(i-1));                }                System.out.println();            }        }        sc.close();    }}
原创粉丝点击