Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- static int a, b, c, d, e;
- int najm();
- int najw();
- int main() {
- std::setlocale(LC_ALL, "pl_PL.UTF-8");
- cout << "Podaj liczby: ";
- cin >> a >> b >> c >> d >> e;
- cout << "Najmniejsza wartość: "<< najm() << endl;
- cout << "Największa wartość: " << najw() << endl;
- return 0;
- }
- int najm() {
- int m = a;
- if(b < m) m = b;
- if(c < m) m = c;
- if(d < m) m = d;
- if(e < m) m = e;
- return m;
- }
- int najw() {
- int m = a ;
- if(b > m) m = b;
- if(c > m) m = c;
- if(d > m) m = d;
- if(e > m) m = e;
- return m;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement