java怎样对二维数组的每一列进行操作?
前面已经把文件读出来了publicstaticvoidmain(String[]args)throwsIOException{@SuppressWarnings("res...
前面已经把文件读出来了 public static void main(String[] args) throws IOException {
@SuppressWarnings("resource")
Scanner scan = new Scanner(System.in);
String str = scan.nextLine();
String str1 = readFileContent(str);
BufferedWriter bw = new BufferedWriter(new FileWriter("d:\\java\\4.fas"));
String[] a = str1.split(">");
int n = 0;int i= 0;int j = 0;
String[][]b=new String[i][j];
for(int h = 0; h<a[n].length(); h++){
for(int k = 0; k<a.length ; k++){
b[i][j]=a[n];
n++;i++;j++;
int no1 = 0;
int no2 = 0;
int b1=0;
no1+=b[b1][k].replace("-","").length();
no2+=b[b1][k].length();
if(no1/no2>0.2){
b1++;
}
if(no1/no2<0.2){}
bw.write(">"+b[i][j]);
}}
bw.flush();
bw.close();
}}
为什么最后文件里面什么内容都没有呢?我是想对每一列 进行筛选 展开
@SuppressWarnings("resource")
Scanner scan = new Scanner(System.in);
String str = scan.nextLine();
String str1 = readFileContent(str);
BufferedWriter bw = new BufferedWriter(new FileWriter("d:\\java\\4.fas"));
String[] a = str1.split(">");
int n = 0;int i= 0;int j = 0;
String[][]b=new String[i][j];
for(int h = 0; h<a[n].length(); h++){
for(int k = 0; k<a.length ; k++){
b[i][j]=a[n];
n++;i++;j++;
int no1 = 0;
int no2 = 0;
int b1=0;
no1+=b[b1][k].replace("-","").length();
no2+=b[b1][k].length();
if(no1/no2>0.2){
b1++;
}
if(no1/no2<0.2){}
bw.write(">"+b[i][j]);
}}
bw.flush();
bw.close();
}}
为什么最后文件里面什么内容都没有呢?我是想对每一列 进行筛选 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |