#include #include #include #include void sort(int values[], int n);//prototype int main(void) { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ //ask user for the number of candles, should be positive! unsigned int candle_num; do{ //printf("How many candles do you have? "); scanf("%d",&candle_num); } while(candle_num <= 0); //create an array of size candle_num int num_arr[candle_num]; //ask user for all heights for(int i = 0; i < candle_num; i++) { scanf("%d", &num_arr[i]); } //use temp big num int big_num = num_arr[0]; //search for biggest num for (int j = 0; j < candle_num; j++) { if (num_arr[j] > big_num) { big_num = num_arr[j]; } } //initialize big num counter int counter = 0; //find how many times the biggest num appers for (int i = 0; i < candle_num; i++) { if(num_arr[i] == big_num) counter++; } printf("%i\n", counter); return 0; }