Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- float najgolem_broj(int n, float niza[]) {
- float najgolem = niza[0];
- for(int i = 0; i < n; i++) {
- if(niza[i] > najgolem) {
- najgolem = niza[i];
- }
- }
- return najgolem;
- }
- int main() {
- int n;
- cin >> n;
- float niza[n];
- for(int i = 0; i < n; i++) {
- cin >> niza[i];
- }
- cout << najgolem_broj(n, niza) << endl;
- return 0;
- }
- /*
- 5
- 2 3 5 1 8
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement