We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 383e624 commit 6e1d188Copy full SHA for 6e1d188
smallest_multiple/Cargo.toml
@@ -0,0 +1,8 @@
1
+[package]
2
+name = "smallest_multiple"
3
+version = "0.1.0"
4
+edition = "2021"
5
+
6
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
8
+[dependencies]
smallest_multiple/src/main.rs
@@ -0,0 +1,23 @@
+fn main() {
+ println!("{}", smallest_multiple());
+}
+fn smallest_multiple() -> i32 {
+ let mut n: i32 = 20;
+ let mut start: i32;
9
+ loop {
10
+ start = 20;
11
+ while start > 1 {
12
+ if n % start != 0 {
13
+ break ;
14
+ }
15
+ start -= 1;
16
17
+ if start == 1 {
18
19
20
+ n += 1;
21
22
+ n
23
0 commit comments