#include <stdio.h>
#include <stdlib.h>
int myStrlen(char s[]){
int i;
for(i=0;s[i]!='\0';i++);
return i;
}
int main(){
int i, size;
//tがバッファー、sに動的確保する
char *s;
char t[1024];
//tに入力して文字数を数える
size = myStrlen(t);
//intの時と同じように動的確保する
//※大きさだけ注意、「+1」は終端文字の分
s
= (char *)malloc(sizeof(char)*(size
+1));
if(s == NULL){
return 0;
}
//sのほうにtと終端文字を代入
for(i=0;i<size;i++){
s[i] = t[i];
}
s[size] = '\0';
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBteVN0cmxlbihjaGFyIHNbXSl7CiAgICBpbnQgaTsKICAgIGZvcihpPTA7c1tpXSE9J1wwJztpKyspOwogICAgcmV0dXJuIGk7Cn0KCmludCBtYWluKCl7CiAgICBpbnQgaSwgc2l6ZTsKICAgIAogICAgLy9044GM44OQ44OD44OV44Kh44O844CBc+OBq+WLleeahOeiuuS/neOBmeOCiwogICAgY2hhciAqczsKICAgIGNoYXIgdFsxMDI0XTsKICAgIAogICAgc2NhbmYoIiVzIix0KTsKICAgIAogICAgLy9044Gr5YWl5Yqb44GX44Gm5paH5a2X5pWw44KS5pWw44GI44KLCiAgICBzaXplID0gbXlTdHJsZW4odCk7CiAgICAKICAgIC8vaW5044Gu5pmC44Go5ZCM44GY44KI44GG44Gr5YuV55qE56K65L+d44GZ44KLCiAgICAvL+KAu+Wkp+OBjeOBleOBoOOBkeazqOaEj+OAgeOAjCsx44CN44Gv57WC56uv5paH5a2X44Gu5YiGCiAgICBzID0gKGNoYXIgKiltYWxsb2Moc2l6ZW9mKGNoYXIpKihzaXplKzEpKTsKICAgIAogICAgaWYocyA9PSBOVUxMKXsKICAgICAgICBwcmludGYoIkVSUk9SXG4iKTsKICAgICAgICByZXR1cm4gMDsKICAgIH0KICAgIAogICAgLy9z44Gu44G744GG44GrdOOBqOe1guerr+aWh+Wtl+OCkuS7o+WFpQogICAgZm9yKGk9MDtpPHNpemU7aSsrKXsKICAgICAgICBzW2ldID0gdFtpXTsKICAgIH0KICAgIAogICAgc1tzaXplXSA9ICdcMCc7CiAgICBwcmludGYoIiVkIDogJXMiLHNpemUscyk7CiAgICAKICAgIGZyZWUocyk7IC8vZnJlZeOCkuW/mOOCjOOBquOBhAogICAgCiAgICByZXR1cm4gMDsKfQo=