Rivoreo Source Code Repositories
src.rivoreo.one
/
compiler-explorer
/
5f76052a4f1457c335b7c5454d4baa8f3a2a5dae
/
.
/
examples
/
rust
/
Square_Executable.rs
blob: 1750338e601b0902777b0a5d630197e001a7f307 [
file
] [
log
] [
blame
] [
raw
]
use
std
::
env
;
const
fn
square
(
num
:
i32
)
->
i32
{
num
*
num
}
pub
fn
main
()
{
match
env
::
args
().
nth
(
1
).
map
(|
r
|
r
.
parse
::<
i32
>())
{
Some
(
Ok
(
r
))
=>
{
println
!(
"{}"
,
square
(
r
))
}
_
=>
{
println
!(
"Supply a number to square"
)
}
}
}