#include <stdio.h>
typedef int i;
class string
{
public:
char* str;
int len;
char* tstr;
char* ttstr;
int init(int n, const char* st)
{
if(n>0) {
len=n;
str=new char[len];
}
else return -1;
for (i a; a<n; a++) str[a]=st[a];
return 0;
}
};
class pstr
{
public:
int print(string str)
{
if(str.len>0) printf("%s", str.str);
else return -1;
return 0;
}
};
int main()
{
string s;
pstr p;
s.init(14, "hello, world!");
p.print(s);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnR5cGVkZWYgaW50IGk7CmNsYXNzIHN0cmluZwp7CglwdWJsaWM6CgljaGFyKiBzdHI7CglpbnQgbGVuOwogICAgICAgIGNoYXIqIHRzdHI7CiAgICAgICAgY2hhciogdHRzdHI7CiAgICAgICAgaW50IGluaXQoaW50IG4sIGNvbnN0IGNoYXIqIHN0KQoJewoJCWlmKG4+MCkgewoJCQkJbGVuPW47CgkJCQlzdHI9bmV3IGNoYXJbbGVuXTsKCQkJCX0KCQllbHNlIHJldHVybiAtMTsKCQkKICAgICAgICAgICAgICAgIGZvciAoaSBhOyBhPG47IGErKykgc3RyW2FdPXN0W2FdOwoJCXJldHVybiAwOwoJfQoJCn07CmNsYXNzIHBzdHIKewoJcHVibGljOgoJCWludCBwcmludChzdHJpbmcgc3RyKQoJCXsKCQkJaWYoc3RyLmxlbj4wKSBwcmludGYoIiVzIiwgc3RyLnN0cik7CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgcmV0dXJuIC0xOwoJCQlyZXR1cm4gMDsKCQl9Cn07CmludCBtYWluKCkKewogICBzdHJpbmcgczsKICAgcHN0ciBwOwogICBzLmluaXQoMTQsICJoZWxsbywgd29ybGQhIik7CiAgIHAucHJpbnQocyk7CiAgIHJldHVybiAwOwp9