Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
HuyLe
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class User { public float Number { set; get; } } public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); var a = new float[] { 1, 2 }; Total(a); // = 3 // sai ở đâu } public static void Calculator(float number, User u) { var a = u.Number + number; u.Number = a; // save user //... } public static void Total(float[] a) { var dics = new Dictionary<string, User>(); foreach (var aa in a) { if (!dics.ContainsKey("u1")) dics["u1"] = new User(); Calculator(aa, dics["u1"]); //Console.WriteLine("dic[u1]="+ dics["u1"].Number ); //dics["u1"].Number = dics["u1"].Number + aa; } Console.WriteLine($"user 3: {dics["u1"].Number}"); } } }
run
|
edit
|
history
|
help
0
Amma
give coins
Main3-3
decimal to binary conversion
Split IPs to 8 and 16
Basma 2
IsDivisibleV2
working aes encryption/decryption
How to count the occurrence of each character in a string?
2. Basic types: List