当前位置:网站首页>7.1-WY22 Fibonacci数列
7.1-WY22 Fibonacci数列
2022-07-20 21:38:00 【syc596】
7.1-WY22 Fibonacci数列
Fibonacci数列_牛客题霸_牛客网 (nowcoder.com)
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int first=0;
int second=1;
int third=0;
while(n>second){
third=first+second;
first=second;
second=third;
}
int ret=Math.min(n-first,second-n);
System.out.println(ret);
}
}
边栏推荐
- How to conduct user retention analysis?
- Translation of UAV intelligent coverage navigation based on DRL in complex geometric environments
- Zhaocai meow | jade meow, brother Tai pours ten thousand Liang, a pear flower, a summer rain
- Wang fried power to create wealth fast! Xiangling giant panda 2.0 power products officially launched
- 这款国产API神器工具也太强了吧...让我放弃了postman
- PHP cross domain solution
- What aspects should we start from to learn the silver K-line chart
- [stc15 controls ws2812 RGB color lamp cascade]
- Excuse me, boss, how does Flink achieve real-time data synchronization between MySQL database and elastic search
- Several stumbling blocks of it entrepreneurs
猜你喜欢
Visual studio easy to use plug-in sharing
In depth analysis: how chain 2+1 mode plays with investment attraction and drainage
Solve the problem of error reporting in NPM installation NRM syntaxerror: unexpected token import
Dama Chapter 3 (Data Governance)
Dama Chapter 11 (data warehouse and business intelligence)
Wang fried power to create wealth fast! Xiangling giant panda 2.0 power products officially launched
Wechat vaccine appointment applet graduation project of applet completion work (7) mid term inspection report
Shape and boundary-aware multi-branch model for semi-supervised medical image segmentation
In the e-commerce industry with fierce competition, why can the chain 2+1 mode survive for so long?
Le moteur 3D de dtos titos remplacera le moteur de jeu Giant Beast et réalisera la substitution de localisation
随机推荐
ROS从入门到精通(十) TF坐标变换原理,为什么需要TF变换?
Cad2014 x64 debugging ARX
2022第五届中国(济南)国际青少年眼健康产业展览会9月举办
The difference between soft link and hard link and how the file system takes files
IIO device driver of I2C client driver
The middle-aged crisis in the Internet industry is the watershed of 35 years old
Difference between service and systemctl / method of modifying path / a command to view IP address, gateway and DNS server
DTOS帝拓思的3D引擎将取代游戏引擎巨兽,实现国产化替代
Go语言实现超时的方法有哪些
2022 Shandong vision prevention and control conference, China eye care products exhibition, Jinan myopia correction equipment exhibition
2022护眼灯展,中医眼科调理展,山东眼睛保健展,中国眼博会
Swiftui uses spritekit to create rain animation effects (tutorial includes source code)
[kaggle] how to effectively avoid oom (out of memory) and long alchemy process
專注跨境支付一體化服務 iPayLinks榮獲《財資》(The Asset)3A亞洲獎!
Wechat vaccine appointment applet graduation design of applet completion works (1) development outline
专注跨境支付一体化服务 iPayLinks荣获《财资》(The Asset)3A亚洲奖!
致测试/开发程序员:爱生活,不加班,苦逼的程序员......
Modify the computer registry and add vscode to the right-click menu
Excuse me, boss, how does Flink achieve real-time data synchronization between MySQL database and elastic search
Why is sha256 irreversible and how secure is sha256