Farjana_akter

Untitled

Mar 20th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3.  
  4.  
  5. int main()
  6. {
  7. long long int n,i,j,k;
  8. scanf("%lld",&n);
  9. long long int arr[n+5],mx=0,cnt=0;
  10.  
  11. for(i=0;i<n;i++)
  12. {
  13. scanf("%lld",&arr[i]);
  14. if(arr[i]==mx)
  15. cnt++;
  16. if(arr[i]>mx)
  17. {
  18. mx=arr[i];
  19. cnt=1;
  20. }
  21. }
  22. if(cnt>1)
  23. printf("The world is doomed! :(\n");
  24. else
  25. printf("%lld\n",mx);
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment