如何声明数组列表

如何声明数组列表

本文介绍了如何声明数组列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个情况,我有比较数据需求,对于每个数据需求,应该有n个数据. n应该在运行时给出.

让我们考虑一下,我需要

数量少于10的产品代码

价格大于100的产品代码

生产日期少于6个月的产品代码.

以此类推....

所以我想将所有这些数据保存在某种结构中.在运行时,当我输入为5时,应该有5个  prodcode数量< 10,5个  prodcode的价格为> 100和5个带有manu.date<的产品6个月.

我有获取数据的算法,但是我怀疑是否还有更好的方法来保存这些数据,而不是为每个数据分别创建数组?因为所有这些仅具有产品代码

谢谢.

解决方案


Hi All,

I have a scenario where i have diff data need and for each data need there should be n number of data. The n should be given during runtime.

Let us consider this, i need 

productcode whose quantity is less than 10

productcode whose price is greater than 100

productcode with manufatureddate less than 6 mnths.

and so on ....

so i want to hold all these data in some structure. During runtime when i input as 5 then there should be 5  prodcode quantity <10, 5  prodcode with price> 100 and 5 prodcode  with manu.date < 6 mnths.

i have the algorithm to get the data but my doubt is whether there is any better way to hold these data instead of creating array separately for each? as all these will have the productcode only

Thanks.

解决方案


这篇关于如何声明数组列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 15:17