本文介绍了如何从2个相似的列表中选择每个&lt;&gt;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有两个不同的List<>来自下面给出的Foood类。 如何从每个列表中选择: x1.calories + x2.calories<可以满足CertainValue 吗? 我尝试了什么: 公共类Foood { public string Name {get;组; } 公共双卡路里{get;组; } public Foood(字符串名称,双卡路里) { this.Name = name; this.calories = calory; } } 解决方案 I have two different List<> from the Foood class given below.How can I select from each list such that :x1.calories + x2.calories < CertainValuecan be satisfied?What I have tried:public class Foood { public string Name { get; set; } public double calories { get; set; } public Foood(string name, double calory) { this.Name = name; this.calories = calory;}} 解决方案 这篇关于如何从2个相似的列表中选择每个&lt;&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-27 05:24