[Coding] 100までの素数@XQuery
Posted by
A Diary Which Heads for Convergence (Naist branch).
at
2006-06-22 18:01
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 -