efimovdk
2
Q:

c# map

var accounts = new Dictionary<string, double>();

// Initialise to zero...

accounts["Fred"] = 0;
accounts["George"] = 0;
accounts["Fred"] = 0;

// Add cash.
accounts["Fred"] += 4.56;
accounts["George"] += 1.00;
accounts["Fred"] += 1.00;

Console.WriteLine("Fred owes me ${0}", accounts["Fred"]);
3
    //retorna a soma de todos os itens do array
	static int simpleArraySum(int[] ar) {
        return ar.Aggregate((acc, x) => acc + x);
    }
0

Tags

New to Communities?

Join the community