Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Reward
//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 Program { public static void Main(string[] args) { int itemCount = 10; int playerCount = 3; float percentReward = 0.5f; for (int i = playerCount; i > 0; i--) { if (i == 1){ Console.WriteLine(itemCount); } else { int playerReward = (int)Math.Ceiling((double)itemCount * percentReward ); Console.WriteLine(playerReward); itemCount -= playerReward; } } } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Ok
Overloading
Decimal Test2
my cool stuff
Pizzas&Tuples&Golden-Medal
BankAccount
4
Order of Ops 5 (easier)
a
gyakorlas
Please log in to post a comment.