freopen("XXX.in","w",stdin); freopen("XXX.out","a",stdout);
rt,关键字“a"是读写模式,输出的内容接在“XXX.out"的后面,并继承原来的答案。