本人化学硕士,最近准备转行找工作,华为、网易一面就凉了,没想到自己这么菜鸡。接下来校招开始,一大波笔试来袭,不会的边记边总结。
话不多说,看题目:
public class Main{
public static int [] startIndexAndCircleLength(int a,int b) {
int [] arr=new int [2];
StringBuilder sb=new StringBuilder();
int zheng=a/b; //整数部分
int startIndex=0;
int CircleLength=0;
if(a%b!=0) {
sb.append(zheng).append(".");
int yu=a%b; //余数部分
Map <Integer,Integer> map =new HashMap<>();
while(yu!=0) {
int temp=yu*10/b;
if(map.con