Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.16 KB | None | 0 0
  1. int a[];
  2. max1 = 0;
  3. max2 = 0;
  4. for (int i = 0; i < n; ++i)
  5.     if (a[i] > max1) {
  6.         max2 = max1;
  7.         max1 = a[i];
  8.         continue;
  9.     }
  10. if (a[i] > max2)
  11. max2 = a[i];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement