https://atcoder.jp/contests/abc239/tasks/abc239_b
余りと同じで商もPythonならそのままなのですが。
// Integer Division #![allow(non_snake_case)] use std::collections::HashSet; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut line).ok(); line.trim().parse().ok().unwrap() } fn int_div(n: i64, d: i64) -> i64 { if n >= 0 { n / d } else { (n - d + 1) / d } } fn main() { let X: i64 = read(); println!("{}", int_div(X, 10)) }