Iterate though, find the maximum value (call it MAXVAL
), then iterate through once more and multiply every value in the list by (100/MAXVAL)
.
var ratio = 100.0 / list.Max();
var normalizedList = list.Select(i => i * ratio).ToList();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…