📅  最后修改于: 2022-03-11 15:00:58.739000             🧑  作者: Mango
var value=0var n = 10var i = 2for i in 2 ... n-1{ if(n%i==0) { value = 1; break; }}if(value==1){ print("\(n)" + " not prime")}else{ print("\(n)" + " prime")}