There are X spiders, Y dragonflies and (18-x-y) cicadas.
From the total logarithm of wings, we can get:
2y+( 18-x-y)=20
y=x+2
Judging from the total number of legs:
8x+6y+6( 18-x-y)= 1 18
therefore
8x+6(x+2)+6( 18-x-x-2)= 1 18
14x+ 12+96- 12x = 1 18
2x= 10
x=5
So y=x+2=7,
18-x-y=6
So there are five spiders, seven dragonflies and six cicadas.