📌  相关文章
📜  javascript代码示例中的生日蛋糕蜡烛hackerrank解决方案

📅  最后修改于: 2022-03-11 15:03:15.308000             🧑  作者: Mango

代码示例2
#include #include #include #include #include #include #include #include #include /*Birthday Cake Candles Code in C*/int main() {int i;int n;int max = 0;scanf("%d", & n);int a[n];int count = 0;for (i = 1; i <= n; i++) {scanf("%d", & a[i]);if (max < a[i])max = a[i];}for (i = 1; i <= n; i++)if (a[i] == max)count++;printf("%d", count);return 0;}