#include <stdio.h>
#include <math.h>
#define QTD_ELEMENTOS 5
int main() {
int vetor[QTD_ELEMENTOS];
for (int i = 0; i < QTD_ELEMENTOS; i++) {
//printf("Digite um nĂºmero: ");
}
int somatorio = 0;
for (int i = 0; i < QTD_ELEMENTOS; i++) {
somatorio += vetor[i];
}
float media = somatorio / (float) QTD_ELEMENTOS;
float variacoes = 0;
for (int i = 0; i < QTD_ELEMENTOS; i++) {
float v = vetor[i] - media;
variacoes += v * v;
}
float sigma
= sqrt(variacoes
/ QTD_ELEMENTOS
); printf("Resultado d = %.2f\n", sigma
); }
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgojZGVmaW5lIFFURF9FTEVNRU5UT1MgNQoKaW50IG1haW4oKSB7CiAgICBpbnQgdmV0b3JbUVREX0VMRU1FTlRPU107CgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBRVERfRUxFTUVOVE9TOyBpKyspIHsKICAgICAgICAvL3ByaW50ZigiRGlnaXRlIHVtIG7Dum1lcm86ICIpOwogICAgICAgIHNjYW5mKCIlZCIsICZ2ZXRvcltpXSk7CiAgICB9CgogICAgaW50IHNvbWF0b3JpbyA9IDA7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IFFURF9FTEVNRU5UT1M7IGkrKykgewogICAgICAgIHNvbWF0b3JpbyArPSB2ZXRvcltpXTsKICAgIH0KCiAgICBmbG9hdCBtZWRpYSA9IHNvbWF0b3JpbyAvIChmbG9hdCkgUVREX0VMRU1FTlRPUzsKCiAgICBmbG9hdCB2YXJpYWNvZXMgPSAwOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBRVERfRUxFTUVOVE9TOyBpKyspIHsKICAgICAgICBmbG9hdCB2ID0gdmV0b3JbaV0gLSBtZWRpYTsKICAgICAgICB2YXJpYWNvZXMgKz0gdiAqIHY7CiAgICB9CgogICAgZmxvYXQgc2lnbWEgPSBzcXJ0KHZhcmlhY29lcyAvIFFURF9FTEVNRU5UT1MpOwogICAgcHJpbnRmKCJSZXN1bHRhZG8gZCA9ICUuMmZcbiIsIHNpZ21hKTsKfQ==