Advertisement
josiftepe

Untitled

Mar 24th, 2022
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. using namespace std;
  4. int main()
  5. {
  6. int broj;
  7. int najgolem = -1, flag = 0;
  8. while(true) {
  9. cin >> broj;
  10. if(broj == 0) {
  11. break;
  12. }
  13. if(flag == 0) {
  14. najgolem = broj;
  15. flag = 1;
  16. }
  17. else if(flag == 1) {
  18. if(najgolem < broj) {
  19. najgolem = broj;
  20. }
  21. }
  22. }
  23. cout << najgolem << endl;
  24. return 0;
  25. }
  26. // 1 2 3 0 5 6 7 0 1 2 3 0 9 9 9
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement