zj3t

email: euntaejang@gmail.com

Latest Posts

Algospot-Encypt

By 오전 11:53

쉬운문제라 따로 설명은 없습니다~



#include <stdio.h>
#include <string.h>

int main() {
int test = 0;
int tem = 0;
int len = 0;
char old[101] = { 0, };
char new_[101] = { 0, };

scanf("%d", &test);

for (int i = 0; i < test; i++) {
scanf("%s", old);
len = strlen(old);
tem = 0;
new_[len] = { 0, };

for (int j = 0; j < len; j = j + 2) {
new_[tem] = old[j];
tem++;
}
for (int h = 1; h < len; h = h + 2) {
new_[tem] = old[h];
tem++;
}
printf("%s\n", new_);
}
return 0;
}

You Might Also Like

0 개의 댓글