找了个87060013试了一下,有结果出来(但没有验证是否正确):
==============================================
查询物品代码(数量): 87060013(1)
最终原材料代码(数量):
73080017(4),75000005(4),75030655(4),75030723(17),75030939(16),75040142(4),75040214(4),75050115(4),75050116(16),75050139(17),75050171(16),75050172(17),75050173(8),75050174(1),77060009(1),77990000(1),77990016(1),77990017(1),77990018(4),77990019(1),77990020(1),77990021(1),77990022(1),77990154(8),77990156(1),78000017(1),80990022(1),80990144(1),10060219(1),10200299(1),10200370(1),60009222(1),71041719(1),73130102(1),75000017(4),75030645(8),75030647(4),75030658(2),75030661(4),75030662(4),75030787(4),75040136(4),75040138(2),75050052(4),75050111(10),75050113(4),75050115(12),75050119(12),75050120(4),75050123(10),75070047(1),75080221(1),75080222(1),75090003(4),76000038(1),76010001(1),77020003(1),77020020(1),77020038(2),77020004(1),77020005(1),77040000(2.13),77020000(1),77020001(1),77020004(1),77020008(1),77020009(1),77040000(1.2),77020004(1),77020005(1),77040000(1.68),77020002(1),77020006(1),77020007(1),77040001(1.1),77090000(1),80010045(1),80040700(1),71000311(24.68),80041001(1),71000308(12.0932),71030009(4.5039),10060011(3),60009618(1),60009619(1),60010040(1),75080226(1),75080300(3),75100015(3),77010000(1),77050003(1),98000293(1),71041415(5.0232),71020502(2.2627),98000292(1),98000291(1),80150001(2),80990120(1),76180001(1),10010002(1),75030652(4),75050116(4),75080229(5),71060015(.4988),71060014(6.8992),71030009(4.5039),71000318(8.8848),71000110(.9819),71000132(.8843),10090022(1),75030659(4),75030660(4),75040137(4),75050116(4),75050117(4),75050118(8),75050122(8),77080038(1),77080004(1),78000014(1)
但速度不行(大约10来20秒)。。。由于用的是字符串方法(其实这问题就是一历遍树的问题,网上已有很多算法、代码等。。但这里用字符串是因为觉得这种思路有趣想真的实现一下),vb的字符串处理速度那是出名的杯具,也只能这样了。。。
有空好好研究楼上那专家的代码。。。
[ 本帖最后由 lsftest 于 2011-1-7 23:54 编辑 ] |