Leedwon

Untitled

Jan 19th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. int f0(int n, int tab_empty) {
  2.     if (tab_empty == 1)
  3.         read(n);
  4.     int Smallest = tab_int[0];
  5.     int positionOfSmallest = 0;
  6.  
  7.     for (int i = 0; i < n; i++) {
  8.         if (tab_int[i] < Smallest) {
  9.             Smallest = tab_int[i];
  10.         }
  11.     }
  12.     for (int i = 0; i < n; i++) {
  13.         if (tab_int[i] == Smallest) {
  14.             cout << i + 1 << " "; // zmiana tutaj
  15.         }
  16.     }
  17.     cout << endl;
  18.     return positionOfSmallest;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment