#include<iostream>
using namespace std;
int* pus(int b){
int top;
int max;
max=5;
int* a=new int[5];
srand(time(0));
int number;
for(top=0;top<max;top++){
number=rand()%10;
a[top]=number;
}
return a;
}
int* po(int arraypo[], int g){
for(int i=g;i>=0;i--){
arraypo[i]=0;
}
return arraypo;
}
int main(){
int st=5;
int * z;
z=pus(st);
cout<<"main: "<<pus(st)<<endl;
cout<<z[0]<<" "<<z[1]<<" "<<z[2]<<" "<<z[3]<<" "<<z[4]<<endl;
cout<<&z[0]<<" "<<&z[1]<<" "<<&z[2]<<" "<<&z[3]<<" "<<z[4]<<endl;
z=po(z, st);
cout<<z[0]<<" "<<z[1]<<" "<<z[2]<<" "<<z[3]<<" "<<z[4]<<" "<<endl;
cout<<&z[0]<<" "<<&z[1]<<" "<<&z[2]<<" "<<&z[3]<<" "<<&z[4]<<endl;
delete z;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKICBpbnQqIHB1cyhpbnQgYil7CiAgICBpbnQgdG9wOwogICAgaW50IG1heDsKICAgIG1heD01OwoKICAgIGludCogYT1uZXcgaW50WzVdOwoKICAgIAogICAgICBzcmFuZCh0aW1lKDApKTsKICAgICAgaW50IG51bWJlcjsKICAgICAgZm9yKHRvcD0wO3RvcDxtYXg7dG9wKyspewogICAgICBudW1iZXI9cmFuZCgpJTEwOwogICAgICBhW3RvcF09bnVtYmVyOwogICAgICB9CnJldHVybiBhOwp9CiAgICAgIAppbnQqIHBvKGludCBhcnJheXBvW10sIGludCBnKXsKICBmb3IoaW50IGk9ZztpPj0wO2ktLSl7CiAgYXJyYXlwb1tpXT0wOwogIH0KcmV0dXJuIGFycmF5cG87Cn0gICAgIAogICAgICAKCgppbnQgbWFpbigpewogIGludCBzdD01OwogIGludCAqIHo7CiAgej1wdXMoc3QpOwoKCgogIGNvdXQ8PCJtYWluOiAiPDxwdXMoc3QpPDxlbmRsOwogIGNvdXQ8PHpbMF08PCIgIjw8elsxXTw8IiAiPDx6WzJdPDwiICI8PHpbM108PCIgIjw8els0XTw8ZW5kbDsKICBjb3V0PDwmelswXTw8IiAiPDwmelsxXTw8IiAiPDwmelsyXTw8IiAiPDwmelszXTw8IiAiPDx6WzRdPDxlbmRsOwoKCiAgej1wbyh6LCBzdCk7CiAgY291dDw8elswXTw8IiAiPDx6WzFdPDwiICI8PHpbMl08PCIgIjw8elszXTw8IiAiPDx6WzRdPDwiICI8PGVuZGw7CiAgY291dDw8JnpbMF08PCIgIjw8JnpbMV08PCIgIjw8JnpbMl08PCIgIjw8JnpbM108PCIgIjw8JnpbNF08PGVuZGw7CgoKCiAgZGVsZXRlIHo7CiAgcmV0dXJuIDA7Cn0gCgoKCg==