SHARE
TWEET

Matura Zadania 2.1,2.2

a guest Feb 21st, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Zadanie 2.1
  2. for i in range(1,n+1):
  3.     Tab[i] = X[i] / Y[i]
  4. Min = Tab[1]
  5. Indeks_min = 1
  6. for i in range(2,n+1):
  7.     if Tab[i] < Min:
  8.         min = Tab[i]
  9.         Indeks_min = i
  10. print("X",X[Indeks_min])
  11. print("Y",Y[Indeks_min])
  12. #Zadanie 2.2
  13.  
  14. for i in range(1,n+1):
  15.     Tab[i] = X[i] / Y[i]
  16.  
  17. for j in range(1,n+1):
  18.     Min = Tab[j]
  19.     Ideks_Min = j
  20.     for i in range(j,n+1):
  21.         if Tab[i] < Min:
  22.             Min = Tab[i]
  23.             IndeksMin = i
  24.         X[j] = X[Indeks_min]
  25.         Y[j] = Y[Indeks_min]
  26.         Tab[j] = Tab[Indeks_min]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top