From d-wave to s-wave pairing in the iron-pnictide superconductor (Ba,K)Fe2As2