Advertisement
ULK

Untitled

ULK
Jan 15th, 2023
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int const runner = 23;
  7. int a[runner];
  8. for (int i = 0; i < runner; i++) {
  9. a[i] = rand() % 10 + 1;
  10. }
  11.  
  12. for (int i = 0; i < runner; i++) {
  13. cout << a[i] << " ";
  14. }
  15.  
  16. int min = 100;
  17. int r;
  18. for (int i = 0; i < runner; i++) {
  19.  
  20. if (a[i] < min) {
  21. min = a[i];
  22. r = i + 1;
  23. }
  24. }
  25. cout << endl;
  26. cout << "#" << r << " " << min;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement