use ::std::io; fnmain() { letmut n = String::new(); io::stdin().read_line(&mut n).expect("输入错误"); let n: i64 = n.trim().parse().expect("不是数字"); letmut index = 0; letmut first = 0; letmut second = 1; while index <= n { if index == 0 || index == 1 { println!("count {}", index); } else { let count: i64 = first + second; first = second; second = count; println!("count {}", count); } index += 1; } }