![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
循环
唐雨菲
会哭会笑,浑身带着骄傲。
展开
-
java写素数
package neice; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Sushu { public static void main(String[] args) { System.out.println(Arrays.toString(Sushu(100)))...原创 2019-06-12 16:16:26 · 551 阅读 · 1 评论 -
java写斐波那切数列和兔子数
public class NaQie { public static void main(String[] args) { Tuzi(11); } public static void Tuzi(int oper) { int n=1; int m=1; int sum=m+n; int[] num=new int[oper]; num[0]=n; num[1]=m; num[2]=sum; fo...原创 2019-06-12 16:45:01 · 298 阅读 · 0 评论 -
面试题,要求固定几位数,长度不满足前补0和后追加
public static void main(String[] args) { int maxLength =7; double num1=18.3; String num =String.valueOf(num1); StringBuffer sb = new StringBuffer(num); if (num.length()<maxLength){ for (int i=0;i&l...原创 2019-06-12 09:22:39 · 252 阅读 · 0 评论