Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- using namespace std;
- int main()
- {
- int broj;
- int najgolem = -1, flag = 0;
- while(true) {
- cin >> broj;
- if(broj == 0) {
- break;
- }
- if(flag == 0) {
- najgolem = broj;
- flag = 1;
- }
- else if(flag == 1) {
- if(najgolem < broj) {
- najgolem = broj;
- }
- }
- }
- cout << najgolem << endl;
- return 0;
- }
- // 1 2 3 0 5 6 7 0 1 2 3 0 9 9 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement