#include <stdio.h>
#include <stdlib.h>
int main(){
int array[100], i=0, valor, max, min, soma=0;
printf("Entre com numeros inteiros // flag = -1:\n");
while (1){
printf("Entre com o %d numero: ",i+1);
scanf("%d",&valor);
if (valor==-1)
break;
fflush(stdin);
array[i] = valor;
soma += array[i];
i++;
}
valor = i;
max =array[0];
min = array[0];
for (i=1;i<valor;i++){
if (array[i] > max)
max = array[i];
if (array[i] < min)
min = array[i];
}
printf("Menor valor: %d\nMaior valor; %d\n Soma de todos os valores: %d\n",min,max,soma);
return 0;
}