#include#include#include#includeusingnamespacestd;ifstreaminfile;ofstreamoutfile;classNode{friendintfunc(int*,int,int,int*);public:intID;doubleweight;//物品的重量};boolcomp1(Nodea,Nodeb)//定义比较规则{return