printf("%lld",ans%10000);换成cout语言是什么?
cout << ans%10000;
cout自动匹配数据类型,所以直接输出想要输出的内容就可以了:cout << ans%10000;如果需要回车符,则写成: cout << ans%10000<< endl;