Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int RASPON(int broj)
- {
- int rez;
- int max=0;
- int min=10;
- do{
- broj = broj % 10;
- if (broj > max)
- {
- max = broj;
- }
- else if (broj < min)
- {
- min = broj;
- }
- broj = broj / 10;
- } while (broj != 0);
- return min;
- }
- int main()
- {
- int broj;
- cout << "upisi broj";
- cin >> broj;
- cout << "Rezultat" << RASPON(broj) << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement