Birthday Cake Candles

  • + 0 comments

    I tried same in java. It worked! Thanks (:

    int temp, max = 0, result = 0, n;
    for (int i = 0; i < arCount; i++) {
        n = scanner.nextInt();
        temp = (max < n) ? (result = ((max = n) >= 0) ? 1 : 1) : (result += (n == max) ? 1 : 0);
        }