2021-04-04 14:14:06 +02:00
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)], pom[(match(maxi, pom)+1):length(pom)])
|
|
|
|
print(pom)
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-2], pom[(match(maxi, pom)):length(pom)])
|
|
|
|
print(pom)
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)])
|
|
|
|
print(pom)
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
gorne <- (match(maxi, pom)+1)
|
|
|
|
if (gorne > length(pom)){
|
|
|
|
gorne <- length(pom)
|
|
|
|
}
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[gorne:length(pom)])
|
|
|
|
print(pom)
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
gorne <- (match(maxi, pom)+1)
|
|
|
|
if (gorne > length(pom)){
|
|
|
|
gorne <- length(pom)
|
|
|
|
}
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[gorne:length(pom)])
|
|
|
|
print(pom[1:match(maxi, pom)-1])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)])
|
|
|
|
print(pom[(match(maxi, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)])
|
|
|
|
print(pom[(match(maxi, pom)):length(pom)])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)])
|
|
|
|
print(pom[(match(maxi, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)])
|
|
|
|
print(pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
print(pom)
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
print(pom[x != NA])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
print(!is.na(x))
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
print(pom[!is.na(x)])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
print(pom[!is.na(pom)])
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
pom <- pom[!is.na(pom)]
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,7,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
pom <- pom[!is.na(pom)]
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)):length(pom)-1])
|
|
|
|
pom <- pom[!is.na(pom)]
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
pom <- pom[!is.na(pom)]
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,4,5,1,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
pom <- pom[!is.na(pom)]
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,8,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
pom <- pom[!is.na(pom)]
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|
|
|
|
# ZAD 5
|
|
|
|
x <- c(1,2,3,7,5,6,7)
|
|
|
|
minmax <- function(x){
|
|
|
|
if (length(x) < 3){
|
|
|
|
return("za krótki argument")
|
|
|
|
}
|
|
|
|
liczby <- c()
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
mini <- min(pom)
|
|
|
|
pom <- c(pom[1:match(mini, pom)-1], pom[(match(mini, pom)+1):length(pom)])
|
|
|
|
liczby <- c(liczby, mini)
|
|
|
|
}
|
|
|
|
pom <- x
|
|
|
|
for(licznik in 1:3){
|
|
|
|
maxi <- max(pom)
|
|
|
|
pom <- c(pom[1:match(maxi, pom)-1], pom[(match(maxi, pom)+1):length(pom)+1])
|
|
|
|
pom <- pom[!is.na(pom)]
|
|
|
|
liczby <- c(liczby, maxi)
|
|
|
|
}
|
|
|
|
return(liczby)
|
|
|
|
}
|
|
|
|
print(minmax(x))
|