当前位置:网站首页>字典与int矩阵
字典与int矩阵
2022-07-26 10:41:00 【Lovey_北禾】
字典——Dictionary
字典常用的方法——fo'reach循环
foreach (var item in list)
{
//Key的值:item.Key,value的值:item.Value;
//通过值找键
if (list.ContainsValue("值"))
{
item.Key//找到键
}
//通过键找值
if (list.ContainsKey(键))
{
item.Value//找到值
}
}
int矩阵——int[][]
就是好几个数组组成一个矩阵,先扒开分开各个数组,在进去各个数组里面寻找具体数组的元素。
int[][] mat;
for (int i = 0; i < mat.Length; i++)
{
for (int j = 0; j < mat[i].Length; j++)//第i个数组
{
if (mat[i][j] == 1)//第i个数组里面的第j个元素
{
}
}
}
边栏推荐
- 对面向抽象编程的理解
- 鹏哥C语言——扫雷2021-08-16
- 剑指Offer(二十):包含min函数的栈
- [notes on machine learning] [building a cyclic neural network and its application] deeplearning ai course5 1st week programming(keras)
- Datav beautiful data screen production experience
- Issue 6: which mainstream programming language should college students choose
- Oracle cannot start tnslistener service cannot start
- 7-25 0-1背包 (50分)
- C language calculation date interval days
- [leetcode每日一题2021/4/23]368. 最大整除子集
猜你喜欢

Application of.Net open source framework in industrial production

IAR sprintf 浮点 在UCOS 总格式化成0.0的问题
![[machine learning notes] [style transfer] deeplearning ai course4 4th week programming(tensorflow2)](/img/94/ff52b043320b6dea5ca1238e314de8.png)
[machine learning notes] [style transfer] deeplearning ai course4 4th week programming(tensorflow2)

工厂模式详解

第7期:内卷和躺平,你怎么选
![[leetcode daily question 2021/8/30]528. Choose randomly by weight [medium]](/img/13/c6cb176d7065035f60d55ad20ed1bf.png)
[leetcode daily question 2021/8/30]528. Choose randomly by weight [medium]

344.反转字符串

el-table实现可编辑表格
![[machine learning notes] [face recognition] deeplearning ai course4 4th week programming](/img/7e/9c0e88097b90c0c24ebf86f090805b.png)
[machine learning notes] [face recognition] deeplearning ai course4 4th week programming

按二进制数中1的个数分类
随机推荐
Datav beautiful data screen production experience
Flutter集成极光推送
使用定位实现左中右布局,中间内容自适应
SAP ABAP 守护进程的实现方式
在神州IV开发板上为STemWin 5.22加入触屏驱动
剑指Offer(七):斐波那契数列
A semicolon is missing
控制随机抽中几率 [ C# | Random ]
解决:无法加载文件 C:\Users\user\AppData\Roaming\npm\npx.ps1,因为在此系统上禁止运行脚本 。
抽象工厂及其改进示例
【机器学习小记】【人脸识别】deeplearning.ai course4 4th week programming
[leetcode每日一题2021/2/18]【详解】995. K 连续位的最小翻转次数
The problem of large fluctuation of hx711 data
创建EOS账户 Action
剑指Offer(五十二):正则化表达式
SuperMap IClient for Leaflet 加载高斯克吕格投影三度分带CGCS2000大地坐标系WMTS服务
第5期:大学生入职必备技能之二
C language callback function
flutter 背景变灰效果,如何透明度,灰色蒙板遮罩
剑指Offer(五十三):表示数值的字符串