/*
입력받은 문자열을 암호화하는 코드를 작성하여라.
문자열의 각 단어마다 숫자를 매긴 뒤, 짝수번호 순대로 배열한 뒤 홀수번호 순대로 배열을 이어붙인다.
ex) HelloWorld -> HloolelWrd
*/
#include <iostream>
#include <string>
using namespace std;
int main(){
int count; //테스트 케이스의 수
int size; //입력받은 문자열의 길이
string str; //입력받을 문자열
string encryption_result; //암호화한 문자열
string encryption_even; //짝수번호인 문자만 나열한 문자열
string encryption_odd; //홀수번호인 문자만 나열한 문자열
string *arr; //테스트 케이스만큼 입력받은 문자열들을 저장할 배열
cin>>count; //테스트 케이스 입력받음
if(count>0&&count<11){ //1<=count<=10일 때
arr = new string[count]; //입력받은 케이스만큼 메모리 할당
for(int i=0;i<count;i++){
//fflush(stdin);
cin>>str;
size = str.length(); //문자열의 길이를 잰다
for(int j=0;j<size;j++){ //한글자씩 잘라서 변수에 저장
if(j%2==0){ //짝수번호인 문자들 합침
encryption_even.append(str.substr(j, 1));
}
else{ //홀수번호인 문자들 합침
encryption_odd.append(str.substr(j, 1));
}
}
//짝수-홀수 암호화된 문자열들을 합쳐서 완성
encryption_result.append(encryption_even);
encryption_result.append(encryption_odd);
//암호화된 문자열을 배열에 저장
arr[i] = encryption_result;
//사용한 문자열 변수들 초기화
encryption_result.erase();
encryption_even.erase();
encryption_odd.erase();
}
for(int i=0;i<count;i++){
cout<<arr[i]<<endl;
}
}
delete []arr;
return 0;
}