#include <stdio.h>
#include <stdlib.h>
void LerArray(int numElementos , float * elemArray) {
int i;
float num;
for(i = 0; i < numElementos; i++) {
printf("Digite um numero para seu array: "); *(elemArray + i) = num;
}
}
int main() {
int numElementos;
printf("Oi !!! Quantos elementos vc quer armazenar: "); scanf("%d", &numElementos
); float * vetorNum;
vetorNum
= malloc(numElementos
* sizeof(float)); if (vetorNum == NULL) {
printf("Erro na alocação, talvez funcione um um número de elementos menor "); return 0;
}
LerArray(numElementos, vetorNum);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnZvaWQgTGVyQXJyYXkoaW50IG51bUVsZW1lbnRvcyAsIGZsb2F0ICogZWxlbUFycmF5KSB7CiAgaW50IGk7CiAgZmxvYXQgbnVtOwoKICBmb3IoaSA9IDA7IGkgPCBudW1FbGVtZW50b3M7IGkrKykgewogICAgICBwcmludGYoIkRpZ2l0ZSB1bSBudW1lcm8gcGFyYSBzZXUgYXJyYXk6ICAiKTsKICAgICAgc2NhbmYoIiVmIiwgJm51bSk7CiAgICAgICooZWxlbUFycmF5ICsgaSkgPSBudW07CiAgICAgIHByaW50ZigiXG5cbiIpOwogIH0KfQoKaW50IG1haW4oKSB7CiAgaW50IG51bUVsZW1lbnRvczsKICBwcmludGYoIk9pICEhISAgUXVhbnRvcyBlbGVtZW50b3MgdmMgcXVlciBhcm1hemVuYXI6ICIpOwogIHNjYW5mKCIlZCIsICZudW1FbGVtZW50b3MpOwogIHN5c3RlbSgiY2xlYXIiKTsKICBmbG9hdCAqIHZldG9yTnVtOwogIHZldG9yTnVtID0gbWFsbG9jKG51bUVsZW1lbnRvcyAqIHNpemVvZihmbG9hdCkpOwogIGlmICh2ZXRvck51bSA9PSBOVUxMKSB7CiAgCXByaW50ZigiRXJybyBuYSBhbG9jYcOnw6NvLCB0YWx2ZXogZnVuY2lvbmUgdW0gdW0gbsO6bWVybyBkZSBlbGVtZW50b3MgbWVub3IgIik7CiAgCXJldHVybiAwOwogIH0KICBMZXJBcnJheShudW1FbGVtZW50b3MsIHZldG9yTnVtKTsKICBmcmVlKHZldG9yTnVtKTsKICByZXR1cm4gMDsKfQ==