我必须将用户输入 int 作为 dna 序列的长度。我试图返回 numberString 但每次我的数组都有问题
司机
import java.util.Scanner;
public class GenBank1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
System.out.println("Enter a desired DNA sequence length, between 1 and 10 please:");
int inputLength = in.nextInt();
System.out.println(inputLength);
System.out.println(DNA1.toNumString(inputLength));
int[] baseId = new int[inputLength];
for(int i=0;i<=baseId.length;i++){
baseId[i]=inputLength;
int rndmr = (int)(4.0*Math.random());
baseId[i]-=rndmr;
System.out.print(baseId[i]+1 + ",");
}
}
}