看板 Programming 關於我們 聯絡資訊
※ 引述《mikemagic88 (Mikemagic88)》之銘言: : 使用者輸入1 印1-9 : 使用者輸入2 印1-98 (11, 22, 33等重複的不印) : 使用者輸入3 印1-987 (121, 988, 667等有重複的不印) #!/usr/bin/Rscript cat("Enter a number: ") n <- as.integer(readLines(file("stdin"), 1)) s <- formatC(seq(10**n - 1)) unique(vapply(lapply(strsplit(s, ""), unique), paste, character(1L), collapse = "")) 執行: Rscript file.R -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.239.77.6 ※ 文章網址: https://www.ptt.cc/bbs/Programming/M.1480428969.A.942.html
qitar888: 有上色給推 180.176.4.115 01/28 17:13