#include <stdio.h>
int main(void) {
char a[] = "teste1";
char b[] = "teste2";
int tamanho1 = 0;
while (a[tamanho1]) tamanho1++;
int tamanho2 = 0;
while (b[tamanho2]) tamanho2++;
int tamanho3 = tamanho1 + tamanho2 + 1;
char *c
= (char *) malloc(tamanho3
);
for (int i = 0; a[i]; i++) {
c[i] = a[i];
}
for (int i = 0; b[i]; i++) {
c[i + tamanho1] = b[i];
}
c[tamanho1 + tamanho2] = 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CiAgICBjaGFyIGFbXSA9ICJ0ZXN0ZTEiOwogICAgY2hhciBiW10gPSAidGVzdGUyIjsKCiAgICBpbnQgdGFtYW5obzEgPSAwOwogICAgd2hpbGUgKGFbdGFtYW5obzFdKSB0YW1hbmhvMSsrOwoKICAgIGludCB0YW1hbmhvMiA9IDA7CiAgICB3aGlsZSAoYlt0YW1hbmhvMl0pIHRhbWFuaG8yKys7CgogICAgaW50IHRhbWFuaG8zID0gdGFtYW5obzEgKyB0YW1hbmhvMiArIDE7CiAgICBjaGFyICpjID0gKGNoYXIgKikgbWFsbG9jKHRhbWFuaG8zKTsKCiAgICBmb3IgKGludCBpID0gMDsgYVtpXTsgaSsrKSB7CiAgICAgICAgY1tpXSA9IGFbaV07CiAgICB9CgogICAgZm9yIChpbnQgaSA9IDA7IGJbaV07IGkrKykgewogICAgICAgIGNbaSArIHRhbWFuaG8xXSA9IGJbaV07CiAgICB9CgogICAgY1t0YW1hbmhvMSArIHRhbWFuaG8yXSA9IDA7CgogICAgcHJpbnRmKCIlc1xuIiwgYyk7CiAgICBmcmVlKGMpOwp9Cg==