#include <stdio.h>
void criaVetor( int v[ ] , int v1[ ] , int v2[ ] ) {
for ( int i = 0 ; i < 5 ; i++ ) {
v[ i] = v1[ i] ;
}
for ( int i = 0 ; i < 5 ; i++ ) {
v[ i + 5 ] = v2[ i] ;
}
}
void mostraVetor( int v[ ] ) {
for ( int i = 0 ; i < 10 ; i++ ) {
printf ( "O numero posicao [%d] e %d\n " , i
, v
[ i
] ) ; }
}
int main( void ) {
int v[ 10 ] ;
int v1[ ] = { 1 , 2 , 3 , 4 , 5 } ;
int v2[ ] = { 6 , 7 , 8 , 9 , 10 } ;
criaVetor( v, v1, v2) ;
mostraVetor( v) ;
}
//https://pt.stackoverflow.com/q/230630/101
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNyaWFWZXRvcihpbnQgdltdLCBpbnQgdjFbXSwgaW50IHYyW10pIHsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgNTsgaSsrKSB7CiAgICAgICAgdltpXSA9IHYxW2ldOwogICAgfQogICAgZm9yIChpbnQgaSA9IDA7IGkgPCA1OyBpKyspIHsKICAgICAgICB2W2kgKyA1XSA9IHYyW2ldOwogICAgfQp9Cgp2b2lkIG1vc3RyYVZldG9yKGludCB2W10pIHsKCWZvciAoaW50IGkgPSAwOyBpIDwgMTA7IGkrKykgewoJICAgIHByaW50ZigiTyBudW1lcm8gcG9zaWNhbyBbJWRdIGUgJWRcbiIsIGksIHZbaV0pOwoJfQp9CgppbnQgbWFpbih2b2lkKSB7CglpbnQgdlsxMF07CglpbnQgdjFbXSA9IHsxLCAyLCAzLCA0LCA1fTsKCWludCB2MltdID0gezYsIDcsIDgsIDksIDEwfTsKCWNyaWFWZXRvcih2LCB2MSwgdjIpOwoJbW9zdHJhVmV0b3Iodik7Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzIzMDYzMC8xMDE=