import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int a = 1, b = 1, i = 1;
while (i < n){
int c = a + b;
a = b;
b = c;
i ++;
}
System.out.println(a);
}
}
标签:数列,int,System,斐波,sc,那契,public,Scanner From: https://www.cnblogs.com/fghjktgbijn/p/17366431.html2023-05-01 13:08:10 星期一