Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int RASPON(int broj)
  6. {
  7. int rez;
  8. int max=0;
  9. int min=10;
  10. do{
  11. broj = broj % 10;
  12. if (broj > max)
  13. {
  14. max = broj;
  15. }
  16. else if (broj < min)
  17. {
  18. min = broj;
  19. }
  20. broj = broj / 10;
  21. } while (broj != 0);
  22. return min;
  23. }
  24. int main()
  25. {
  26. int broj;
  27. cout << "upisi broj";
  28. cin >> broj;
  29. cout << "Rezultat" << RASPON(broj) << endl;
  30. system("pause");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement