Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int f(int niz[])
- {
- for (int i=0; i<niz[i]; i++)
- {
- if ((niz[i]) % 2 != 0)
- {
- niz[i] = niz[i] * 3;
- }
- if ((niz[i]) % 2 == 0)
- {
- niz[i] = niz[i] * 2;
- }
- }
- int i = 0;
- int MAX = niz[i];
- for (int i = 0; i<niz[i]; i++)
- {
- if (niz[i] >= MAX)
- {
- MAX = niz[i];
- }
- }
- return MAX;
- }
- void g( int x ) {
- for ( int i = 1 ; i <= x ; i++ ) {
- cout<<x<<endl;;
- }
- }
- int main()
- {
- int niz[3];
- cout << "Unesite 3 broja: " << endl;
- cin >> niz[0] >> niz[1] >> niz[2];
- int rez = f(niz);
- g(rez);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment