Fix code formats.

This commit is contained in:
krahets
2023-03-01 03:17:07 +08:00
parent 6659b87ffe
commit 29ae658dea
2 changed files with 12 additions and 9 deletions

View File

@@ -348,15 +348,18 @@
```csharp title="hash_map.cs"
/* 遍历哈希表 */
// 遍历键值对 Key->Value
foreach (var kv in map) {
foreach (var kv in map)
{
Console.WriteLine(kv.Key + " -> " + kv.Value);
}
// 单独遍历键 key
foreach (int key in map.Keys) {
foreach (int key in map.Keys)
{
Console.WriteLine(key);
}
// 单独遍历值 value
foreach (String val in map.Values) {
foreach (String val in map.Values)
{
Console.WriteLine(val);
}
```