#include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;
char * _strcpy( char zdanie2[ ] , char zdanie[ ] )
{
int i = 0 ;
std:: cout << std:: setw ( 3 ) << "i" << "|" ;
std:: cout << std:: setw ( 12 ) << "zdanie2" << "|" ;
std:: cout << std:: setw ( 12 ) << "zdanie" << std:: endl ;
while ( ( zdanie2[ i] = zdanie[ i] ) ! = '\0 ' )
{
std:: cout << std:: setw ( 3 ) << i << "|" ;
std:: cout << std:: setw ( 12 ) << zdanie2 << "|" ;
std:: cout << std:: setw ( 12 ) << zdanie << std:: endl ;
i++ ;
}
return ( zdanie2) ;
}
int main( ) {
char * zdanie = "Ala ma kota" ;
char * zdanie2 = ( char * ) malloc ( sizeof ( char ) * strlen ( zdanie) ) ;
_strcpy( zdanie2, zdanie) ;
std:: cout << zdanie << std:: endl << zdanie2 << std:: endl ;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPGNzdHJpbmc+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpjaGFyICpfc3RyY3B5KGNoYXIgemRhbmllMltdLCBjaGFyIHpkYW5pZVtdKQp7CglpbnQgaSA9IDA7CglzdGQ6OmNvdXQgPDwgc3RkOjpzZXR3KDMpIDw8ICJpIiA8PCAifCI7CglzdGQ6OmNvdXQgPDwgc3RkOjpzZXR3KDEyKSA8PCAiemRhbmllMiIgPDwgInwiOwoJc3RkOjpjb3V0IDw8IHN0ZDo6c2V0dygxMikgPDwgInpkYW5pZSIgPDwgc3RkOjplbmRsOwoJd2hpbGUgKCh6ZGFuaWUyW2ldID0gemRhbmllW2ldKSAhPSAnXDAnKQoJewoJCXN0ZDo6Y291dCA8PCBzdGQ6OnNldHcoMykgPDwgaSA8PCAifCI7CgkJc3RkOjpjb3V0IDw8IHN0ZDo6c2V0dygxMikgPDwgemRhbmllMiA8PCAifCI7CgkJc3RkOjpjb3V0IDw8IHN0ZDo6c2V0dygxMikgPDwgemRhbmllIDw8IHN0ZDo6ZW5kbDsKCQlpKys7Cgl9CglyZXR1cm4gKHpkYW5pZTIpOwp9CgppbnQgbWFpbigpIHsKCWNoYXIgKnpkYW5pZSA9ICJBbGEgbWEga290YSI7CgljaGFyICp6ZGFuaWUyID0gKGNoYXIgKiltYWxsb2Moc2l6ZW9mKGNoYXIpICogc3RybGVuKHpkYW5pZSkpOwoJCglfc3RyY3B5KHpkYW5pZTIsIHpkYW5pZSk7CgkKCXN0ZDo6Y291dCA8PCB6ZGFuaWUgPDwgc3RkOjplbmRsIDw8IHpkYW5pZTIgPDwgc3RkOjplbmRsOwoJCglyZXR1cm4gMDsKfQ==