You are viewing a single comment's thread. Return to all comments →
int main() {
int T, N; //Number of test cases, length of string string word; //holds strings //get number of test cases from input cin >> T; for (int i = 0; i < T; i++) { string temp1, temp2, final; cin >> word; N = word.size(); for (int j = 0; j < N; j++) { if (j % 2 == 0) temp1.push_back(word[j]); else { temp2.push_back(word[j]); } } final = temp1 + " " + temp2; cout << final << endl; } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
int main() {
}