mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-11 06:56:06 +00:00
Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4 * Retranslate Japanese code with GPT-5.4
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* File: Vertex.cs
|
||||
* Created Time: 2023-02-06
|
||||
* Author: zjkung1123 (zjkung1123@gmail.com), krahets (krahets@163.com)
|
||||
*/
|
||||
|
||||
namespace hello_algo.utils;
|
||||
|
||||
/* 頂点クラス */
|
||||
public class Vertex(int val) {
|
||||
public int val = val;
|
||||
|
||||
/* 値リスト vals を入力し、頂点リスト vets を返す */
|
||||
public static Vertex[] ValsToVets(int[] vals) {
|
||||
Vertex[] vets = new Vertex[vals.Length];
|
||||
for (int i = 0; i < vals.Length; i++) {
|
||||
vets[i] = new Vertex(vals[i]);
|
||||
}
|
||||
return vets;
|
||||
}
|
||||
|
||||
/* 頂点リスト vets を入力し、値リスト vals を返す */
|
||||
public static List<int> VetsToVals(List<Vertex> vets) {
|
||||
List<int> vals = [];
|
||||
foreach (Vertex vet in vets) {
|
||||
vals.Add(vet.val);
|
||||
}
|
||||
return vals;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user