Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let mut x = 0;
- let mut y = 1;
- for _ in 1..10 {
- let results = fib(x, y);
- x = results.0;
- y = results.1;
- println!("{}", y);
- }
- }
- fn fib(one: i32, two: i32) -> (i32, i32) {
- return (two, one + two);
- }
Add Comment
Please, Sign In to add comment