CodeQL学习记录(一)
记录官方教学语法题的答案
1 Find the thief
根据下述问题描述找出小偷
难点在于9、10、11的聚合
语句
Question | Answer | |
---|---|---|
1 | Is the thief taller than 150 cm? | yes |
2 | Does the thief have blond hair? | no |
3 | Is the thief bald? | no |
4 | Is the thief younger than 30? | no |
5 | Does the thief live east of the castle? | yes |
6 | Does the thief have black or brown hair? | yes |
7 | Is the thief taller than 180cm and shorter than 190cm? | no |
8 | Is the thief the oldest person in the village? | no |
9 | Is the thief the tallest person in the village? | no |
10 | Is the thief shorter than the average villager? | yes |
11 | Is the thief the oldest person in the eastern part of the village? | yes |
import java
import tutorial
from Person t
where t.getHeight() > 150 and
not t.getHairColor() = "blond