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