using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static class Util
private static double Comp<T>(List<T> l)
double result = 0;
foreach (dynamic s in l)
result += s;
}
return result;
private static void Main(string[] args)
List<float> l = new List<float> { 1, 2, 3, 4.5f };
Console.WriteLine(Comp(l));