You are viewing a single comment's thread. Return to all comments →
HAH! I did the exact same thing. Nice.
int n = in.nextInt(); int j = 0; int max = 0; for(int i = 0; i < n; i++){ int x = in.nextInt(); if(x > max){ j = 1; max = x; } else if(x == max) j++; } System.out.print(j);
Seems like cookies are disabled on this browser, please enable them to open this website
Birthday Cake Candles
You are viewing a single comment's thread. Return to all comments →
HAH! I did the exact same thing. Nice.