zoukankan
html css js c++ java
哈希表
Hashtable在命名空间using System.Collections中,实现基于键值的查找很方便
using
System;
using
System.Collections.Generic;
using
System.Text;
using
System.Collections;
namespace
哈希表
{
class
Program
{
static
void
Main(
string
[] args)
{
Hashtable table
=
new
Hashtable();
Employee P1
=
new
Employee(
"
1
"
,
"
li
"
,
"
21
"
);
Employee P2
=
new
Employee(
"
2
"
,
"
zhang
"
,
"
22
"
);
table.Add(P1.ID, P1);
table.Add(P2.ID, P2);
foreach
(
object
o
in
table.Keys)
{
if
(o
==
"
1
"
)
{
Console.WriteLine(((Employee)table[o]).ID);
Console.WriteLine(((Employee)table[o]).age);
Console.WriteLine(((Employee)table[o]).name);
}
{
}
}
}
public
struct
Employee
{
public
Employee(
string
a,
string
b,
string
c)
{
ID
=
a;
name
=
b;
age
=
c;
}
public
string
ID;
public
string
name;
public
string
age;
}
}
}
肩负责任,永不退缩
查看全文
相关阅读:
POJ 1163 状态转移
POJ 1143 记忆化搜索+博弈论
POJ 1083
POJ 1018
HDU 3572 Dinic
HDU 3549 Dinic
配置JDK环境变量配置及path和classpath的作用
frameset 框架整体退出登录的问题
java计算时间差及比较时间大小(转)
Android—Http连接之GET/POST请求
原文地址:https://www.cnblogs.com/ATP/p/860620.html
最新文章
day09
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
cacti设置redis监控端口
cacti监控多个mysql端口
安装django 提示ImportError: No module named setuptools
python redis插件安装
django设置首页
django为model设置表名
mysql允许远程登录
centos 安装apache
热门文章
centos升级python(从2.6.6升级到2.7.8)
POJ 1609 二维递推
POJ 1458 最长公共子序列
POJ 1414 简单搜索
POJ 1322 递推+奇偶剪枝
POJ 1208
POJ 1191
POJ 1189 记忆化搜索
POJ 1179 记忆化搜索
POJ 1178 预处理+枚举+floyd
Copyright © 2011-2022 走看看