Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
array with c#
//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 SubTable(int[] tableau){ int x =0; int y = 0; if (tableau == null){ return 0; }else{ for (int i=0; i<tableau.Length; i++) { if (tableau[i] % 2 == 0){ y += tableau[i];} if (tableau[i] % 2 == 1){ x += tableau[i];} } return x-y; } } int[] Alex = new int[] {3, 2, 3, 4}; Console.WriteLine(SubTable(Alex)); } } }
run
|
edit
|
history
|
help
0
Trent Butler All Dead Example
Product, Category, Composition and Inheritance
Wait
Fórum ➡ Using Regex to insert "item" tags into the unique "list" tag of an XML data ♦
dxcsdfcsasxd
Sum of numbers in string
D112
enum.TryParse
Problem3 Binary
neja]\