Login
|
Signup
langref.org
-
scala
and
erlang
add..
all
clojure
cpp
csharp
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
python
ruby
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Numbers
Output
Left Space pad a number
Given the number 73 left pad it to 10 characters
" 73"
scala
val formatted = String.format("%10d", int2Integer(73))
object SolutionXX extends Application {
val formatted = String.format("%10d", int2Integer(73))
println(formatted)
}
scala
printf("%10d\n", 73)
object SolutionXX extends Application {
printf("%10d\n", 73)
}
erlang
Formatted = io_lib:format("~10B", [73]),
-module(leftspc).
-export([start/0]).
start() ->
Formatted = io_lib:format("~10B", [73]),
io:format("~s~n", [Formatted]).
erlang
io:format("~10B~n", [73]).
-module(leftspc).
-export([start/0]).
start() ->
io:format("~10B~n", [73]).
Submit a new solution for
scala
or
erlang
There are 24 other solutions in
additional
languages (
clojure
,
cpp
,
csharp
,
fantom
...)