Crates.io | bs_crate |
lib.rs | bs_crate |
version | 0.1.5 |
source | src |
created_at | 2023-10-15 12:31:48.712032 |
updated_at | 2023-10-15 17:37:12.803077 |
description | The palindrome numbers library |
homepage | |
repository | https://github.com/binspammer/palindrome.git |
max_upload_size | |
id | 1003689 |
size | 8,188 |
A "palindrome" is a number that is the same when the digits are reversed. For example, 121, 2332, and 6 are all palindromes. But 10 is not a palindrome (since leading zeroes are not allowed). Treat 0 as a palindrome, and use an unsigned integer type.
Write crate that allows the user to:
If a crate literally implements the question as-is, don't use it.
...
[dependencies]
bs_crate = "0.1.0"
...
The crate should be used like this:
use bs_crate;
fn main() {
let x = 123;
let is_palindrome = bs_crate::is_palindrome(x);
println!("{x} is a palindrome: {is_palindrome}");
let first_10_palindromes = bs_crate::first_n_palindromes(10);
for x in first_10_palindromes {
println!("{x} is a palindrome");
}
}