Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x, najmniejsza_podst = 0;
- cout << "Podaj iloœæ liczb, które chcesz wprowadziæ: ";
- cin >> x;
- int tab[x];
- for (int i = 0; i < x; i++)
- {
- do
- {
- cout << "Podaj liczbê z przedzia³u od 0 do 9 o indeksie " << i << ": ";
- cin >> tab[i];
- } while (tab[i] > 9 || tab[i] < 0);
- if (najmniejsza_podst < tab[i])
- najmniejsza_podst = tab[i];
- }
- najmniejsza_podst++;
- int wyjscie = 0;
- for (int i = 0; i < x; i++)
- {
- wyjscie = wyjscie * najmniejsza_podst + tab[i];
- }
- cout << wyjscie;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement