본문 바로가기
Programming/Judge

Algospot : ENCRYPT

by deviAk 2014. 12. 15.
반응형

Algospot : ENCRYPT


https://algospot.com/judge/problem/read/ENCRYPT


<결과>



<코드>

#include<iostream>
#include<string>

using namespace std;

int main(void)
{
	int num_cases = 0;
	cin >> num_cases;

	for (int n = 0; n < num_cases; ++n)
	{
		string str;
		cin >> str;

		string left_str, right_str;

		for (int i = 0; i < str.size(); ++i)
		{
			if (i % 2 == 0)
				left_str += str.at(i);
			else
				right_str += str.at(i);
		}
		cout << left_str << right_str << endl;
	}
	return 0;
}


반응형