zoukankan      html  css  js  c++  java
  • 常用算法总结

    取两个数组中不相等的部分
    int[] a = { 1, 2, 3, 4, 5, 9 };
    int[] b = { 1, 4, 5, 7, 8, 9 };
    string s_a = "";
    string s_b = "";
    foreach (int i in a)
    {
    s_a
    += i.ToString() + ',';
    }
    foreach (int i in b)
    {
    s_b
    += i.ToString() + ',';
    }
    string value = "不相同的元素:";
    foreach (int i in a)
    {
    if (!s_b.Contains(i.ToString()))
    value
    += i.ToString() + ",";
    }
    foreach (int i in b)
    {
    if (!s_a.Contains(i.ToString()))
    value
    += i.ToString() + ",";
    }
    Response.Write(value);
  • 相关阅读:
    JSON
    event flow
    for,for each,for in,for of
    history of program language
    px fr em rem
    正则符号
    DOM、BOM
    web布局
    grid
    初学python环境安装
  • 原文地址:https://www.cnblogs.com/lhking/p/1683291.html
Copyright © 2011-2022 走看看