Skip to content

Commit

Permalink
Create Birthday_cake_candles_#67.cpp
Browse files Browse the repository at this point in the history
I contributed in cognizance-amrita#67
  • Loading branch information
samarjeetvashistha authored Oct 21, 2022
1 parent 895b1e0 commit d954813
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions c++/Birthday_cake_candles_#67.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;


int main() {
int N; cin>>N;
int a[N];
for(int i=0;i<N;i++) cin>>a[i];
int biggest = 0;
for(int i=0;i<N;i++) biggest = max(biggest, a[i]);
int count = 0;
for(int i=0;i<N;i++) if (a[i] == biggest) count++;
cout<<count<<endl;
return 0;
}

0 comments on commit d954813

Please sign in to comment.