∵数列{an}满足a1=1,a2=2,an+2=(1+cos2
)an+sin2nπ 2
,nπ 2
∴∴a3=(1+cos2
)a1+sin2 π 2
=a1+1=2,π 2
a4=(1+cos2π)a2+sin2π=2a2=4.
一般地,当n=2k-1(k∈N*)时,
a2k+1=[1+cos2
]a2k-1+sin2 (2k?1)π 2
=a2k-1+1,(2k?1)π 2
即a2k+1-a2k-1=1.
∴数列{a2k-1}是首项为1、公差为1的等差数列,
∴a2k-1=k.
当n=2k(k∈N*)时,a2k+2=(1+cos2
)a2k+sin2 2kπ 2
=2a2k.2kπ 2
∴数列{a2k}是首项为2、公比为2的等比数列,
∴a2k=2k.
∴数列的前18项的和为1+2+2+4+3+8+4+16+5+32+6+64+7+128+8+256+9+512=1067.
故选:D.