using System;
using System.Collections.Generic;
using System.Linq; namespace Linq101
{
class CustomSequence
{
public void Linq98()
{
int[] vectorA = { , , , , };
int[] vectorB = { , , , , }; int result = vectorA.Combine(vectorB, (a, b) => a * b).Sum();
Console.WriteLine(result);
}
} public static class CustomSequenceOperators
{
public static IEnumerable<int> Combine(this IEnumerable<int> first, IEnumerable<int> second, Func<int, int, int> func)
{
//List<int> list=new List<int>();
using (IEnumerator<int> e1 = first.GetEnumerator(), e2 = second.GetEnumerator())
{
while (e1.MoveNext() && e2.MoveNext())
{
yield return func(e1.Current, e2.Current);
//list.Add(func(e1.Current, e2.Current));
}
}
//return list;
}
}
}

最新文章

  1. eclipse报错“Undefined variable from import: ...”解决方案
  2. git github 异常
  3. Python: 关于nose
  4. MongoDB学习(一)简介
  5. PostgreSQL Type的创建与Type在函数中的使用
  6. fedora22多媒体编码
  7. Spring与Hibernate、Mybatis整合
  8. leetcode169——Majority Element (C++)
  9. Java 日志缓存机制的实现--转载
  10. [补] winpcap编程——EAPSOCKET实现校园网锐捷登录(mentohust)
  11. Robot Framework之测试用例分层实战
  12. bzoj 2510 弱题 矩阵乘
  13. Mysql的两种“排名第几且有可能为空的记录”写法(力扣176)
  14. #254 Check for Palindromes
  15. pip 解决下载包速度慢的问题
  16. SpringCloud概述
  17. 分布式高性能消息系统(Kafka MQ)的原理与实践
  18. 在 Linux 上搭建IntelliJ IDEA license server服务器
  19. selenium键盘操作
  20. Font Awesome(一套很棒的图标库)

热门文章

  1. phalapi
  2. Java 中 Comparable 和 Comparator 比较(转)
  3. [BZOJ 1188] [HNOI2007] 分裂游戏 【博弈论|SG函数】
  4. iOS Developer Libray (中文版)-- Defining Classes 定义类
  5. 关于用POI和EXCEL交互的问题
  6. Hibernate 配置详解(5)
  7. [置顶] export命令-linux
  8. 【HDOJ】2289 Cup
  9. bzoj1036
  10. poj2228