Your Document Title

Document Author

2021-09-02

系統設置

Sys.setlocale(category = "LC_ALL", locale = "zh_TW.UTF-8") # For ubuntu
## Warning in Sys.setlocale(category = "LC_ALL", locale = "zh_TW.UTF-8"): 作業
## 系統回報無法實現設定語區為 "zh_TW.UTF-8" 的要求
## [1] ""
# Sys.setlocale("LC_CTYPE", "cht") # For windows.

第一次測試

i <- 336
result <- 1
j <- 0

while(i < 366){
  result <- result * i
  i <- i + 1
  j <- j + 1
}

print(result)
## [1] 2.17103e+76
print(paste(j,"次"))
## [1] "30 次"
print("=================")
## [1] "================="

第二次測試

i <- 365
result <- 1
j <- 0

while(i > 335 & i < 366 ){
  result <- result * i
  i <- i - 1
  j <- j + 1
}

print(result)
## [1] 2.17103e+76
print(paste(j,"次"))
## [1] "30 次"
print("=================")
## [1] "================="