You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
xpetit 46f4ddc49e
Simplify prompt, execution of Go programs, fix typos
3 years ago
..
README.md Simplify prompt, execution of Go programs, fix typos 3 years ago

README.md

reverse_it

Instructions

Create a function called reverse_it that takes a number and returns a string with the number backwards followed by the original number. If the number is negative a char - has to be added to the beginning of the string.

Expected Functions

pub fn reverse_it(v: i32) -> String {

}

Usage

Here is a program to test your function,

fn main() {
    println!("{}", reverse_it(123));
    println!("{}", reverse_it(-123));
}

And its output:

$ cargo run
321123
-321123
$