probability - Possible outcome in C# -
I have to find out all the results by throwing four coins at a time
public Zero Tossen () {var coin1 = new string [] {"head", "tail"}; Var coin2 = new string [] {"head", "tail"}; Var coin 3 = new string [] {"head", "tail"}; Var coin4 = new string [] {"head", "tail"}; Var result = First coin 1 second from coin to 2 in coin 2 from third to coin 3 in coin 4 in fourth fourth from fourth (possibility = coin 1 + "," + coin 2 + "," + coin 3 + "," + Coin 4); Foreign Currency (Various OCs in Consequences) {Console.WriteLine (o.possibility.ToString ()); }}}
was output
system.STRING [], ...............
What went wrong?
If you are selecting arrays, you should first select
, second
...
choose new one (possibility = first + "," + second + "," + third + "," fourth} ";
BTW You do not need to make different coin types, you can toss the same coin several times:
var coin = new string [] {"Head", "tail"}; first result = from coin to coin, second from coin to coin, third in coin Before the fourth select the new (probability = first + "," + second + "," + third + "," fourth
Comments
Post a Comment