Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Boo socks
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here float[] originals = {4.75f,0.855f,25f}; float[] nows = {4.64f,0.89f,23.4f}; float [] amount = {8000f,120000f,4000f,1000f}; float x = 0.003577f; float tot = 0; for(int i = 0; i<originals.Count();i++){ tot+=Calc(nows[i],originals[i],amount[i],x); } Console.WriteLine(tot); } public static float Calc(float n, float o, float s, float x){ var ans = (n-o-o*x-n*x)*s; Console.WriteLine(ans); return ans; } } }
run
|
edit
|
history
|
help
0
bc160400236
Compiler
Unity Wall Climbing script Version 1
rzError
Convert string to TimeSpan in C#
AdventCode
Decrypt Encrypt
== and Equals Differeance in C#
IComparable extensions: Between
test