Login
|
Signup
langref.org
-
ruby
,
csharp
, and
erlang
add..
all
clojure
cpp
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
python
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Lists
Declaration
Define a static list
Define the list
[One, Two, Three, Four, Five]
ruby
list = ['One', 'Two', 'Three', 'Four', 'Five']
list = ['One', 'Two', 'Three', 'Four', 'Five']
p list
ruby
list = %w(One Two Three Four Five)
list = %w(One Two Three Four Five)
p list
csharp
IList<string> list = new string[]{"One","Two","Three","Four","Five"};
IList<string> list = new string[]{"One","Two","Three","Four","Five"};
erlang
List = [one, two, three, four, five],
-module(statlist).
-export([start/0]).
start() ->
List = [one, two, three, four, five],
io:format("~B~n", [length(List)]).
erlang
List = ['One', 'Two', 'Three', 'Four', 'Five'],
-module(statlist).
-export([start/0]).
start() ->
List = ['One', 'Two', 'Three', 'Four', 'Five'],
io:format("~B~n", [length(List)]).
Submit a new solution for
ruby
,
csharp
, or
erlang
There are 31 other solutions in
additional
languages (
clojure
,
cpp
,
fantom
,
fsharp
...)