Squares/main.rs

15 lines
411 B
Rust

use std::{i128, io};
fn main() {
println!("To which number do you want the squares");
let mut p = 0;
let mut x = 0;
let mut limit = String::new();
io::stdin().read_line(&mut limit).expect("error");
let mut limit = limit.trim().parse().expect("Type a number");
limit = limit + 1;
while x < limit {
p = i128::pow(x, 2);
println!("{}", p);
x = x + 1;
}
}