Skip to content

Instantly share code, notes, and snippets.

Avatar

Yusei Ueno YuseiUeno

  • Japan Tokyo
View GitHub Profile
@YuseiUeno
YuseiUeno / main.rs
Created Sep 20, 2018
ユークリッドの互除法
View main.rs
extern crate rand;
use rand::Rng;
fn main() {
let (a, b) = (rand::thread_rng().gen_range(1, 999999999), rand::thread_rng().gen_range(1, 999999999));
println!("gcd {}", gcd(&a, &b)); // ランダムに生成した数値の最大公約数
println!("gcd {}", gcd(&1071, &1029)); // 1071, 1029 の最大公約数 21
}
You can’t perform that action at this time.