∵ |x-y+1|+y^2-4y+4=0
∴ |x-y+1|=-(y^2-4y+4)
|x-y+1|=-(y-2)^2
∵ |x-y+1|≥0,-(y-2)^2≤0
∴x-y+1=0 y-2=0
∴y=2,x=1