public static int stick (long a) { // write code here if(a == 3) return 0; long p = 0; long q = 1; long r = 1; long sum = 2; int count = 2; while(true){ p = q; q = r; r = p+q; sum += r; count ++; if(sum>=a) break; } return count; }
1

相关推荐

想去夏威夷的小哥哥在度假:5和6才是重点
点赞 评论 收藏
分享
牛客网
牛客企业服务