You are here: Home Blog Comments [Coding] 100までの素数@XQuery

Personal tools

[Coding] 100までの素数@XQuery

declare function prime($i as xs:integer) as xs:boolean { every $div in (2 to $i - 1) satisfies $i mod $div != 0 }; for $i in (2 to 100) return if(prime($i)) then $i else () XQueryだとこんな感じでしょうか。しょぼーん(´・ω・`)
Parent entry キミならどう書く 2.0 - ROUND 1 -