Skip to content

Instantly share code, notes, and snippets.

View YuseiUeno's full-sized avatar

Yusei Ueno YuseiUeno

View GitHub Profile
use std::io::{stdout, BufWriter, Write};
use rand::Rng;
const DDSK: i32 = 0b011101110111;
const MASK: i32 = 0b111111111111;
fn main() {
let ddsk = ["ドド", "スコ"];
let mut rng = rand::thread_rng();
@YuseiUeno
YuseiUeno / main.rs
Created September 20, 2018 13:19
ユークリッドの互除法
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
}

Atomの設定