#include <stdio.h>
int main( void ) {
int matriza[ 5 ] , matrizb[ 5 ] , indice, cont, soma;
for ( indice = 0 ; indice < 5 ; indice++ ) {
printf ( "\n digite um valor: " ) ; scanf ( "%d" ,& matriza
[ indice
] ) ; for ( soma = 1 , cont = matriza[ indice] ; cont > 1 ; cont-- ) {
soma *= cont;
}
matrizb[ indice] = soma;
}
for ( indice = 0 ; indice < 5 ; indice++ ) {
printf ( "\n O valor do vetor B e: %d \n " , matrizb
[ indice
] ) ; }
return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgbWF0cml6YVs1XSwgbWF0cml6Yls1XSwgaW5kaWNlLCBjb250LCBzb21hOwoJCglmb3IgKGluZGljZSA9IDA7IGluZGljZSA8IDU7IGluZGljZSsrKSB7CiAgICAgICAgcHJpbnRmKCJcbiBkaWdpdGUgdW0gdmFsb3I6ICIpOwogICAgICAgIHNjYW5mKCIlZCIsJm1hdHJpemFbaW5kaWNlXSk7CiAgICAgICAgZm9yIChzb21hID0gMSwgY29udCA9IG1hdHJpemFbaW5kaWNlXTsgY29udCA+IDE7IGNvbnQtLSkgewogICAgICAgIAlzb21hICo9IGNvbnQ7CiAgICAgICAgfQogICAgICAgIG1hdHJpemJbaW5kaWNlXSA9IHNvbWE7Cgl9Cglmb3IgKGluZGljZSA9IDA7IGluZGljZSA8IDU7IGluZGljZSsrKSB7CiAgICAgICAgcHJpbnRmKCJcbiBPIHZhbG9yIGRvIHZldG9yIEIgZTogJWQgXG4iLCBtYXRyaXpiW2luZGljZV0pOwogICAgfQoJcmV0dXJuIDA7Cn0K