1
0
This commit is contained in:
2026-02-04 11:15:03 +08:00
commit 8b20a5dd21
125 changed files with 4177 additions and 0 deletions

6
problems/p33/Cargo.toml Normal file
View File

@@ -0,0 +1,6 @@
[package]
name = "p33"
version = "0.1.0"
edition = "2024"
[dependencies]

33
problems/p33/src/main.rs Normal file
View File

@@ -0,0 +1,33 @@
fn is_non_trivial_fraction(up: u32, down: u32) -> bool {
if !(10..100).contains(&up) {
return false;
}
if !(10..100).contains(&down) {
return false;
}
if up >= down {
return false;
}
let up_1 = up % 10;
let up_10 = up / 10;
let down_1 = down % 10;
let down_10 = down / 10;
// 两个个位相同不可能化简
if up_1 == down_1 {
return false;
}
todo!();
true
}
#[test]
fn test_is_non_trivial_fraction() {
assert!(is_non_trivial_fraction(49, 98));
assert!(!is_non_trivial_fraction(49, 99));
}
fn main() {
println!("Hello, world!");
}