【发布时间】:2015-12-11 04:21:46
【问题描述】:
我有一个二维字符串数组,我想将第二列转换为整数,然后将每一列与一个数字进行比较,但我不知道如何在循环中执行此操作?
int a=Integer.parseInt(array[0][1]);
int b=Integer.parseInt(array[1][1]);
int c=Integer.parseInt(array[2][1]);
int d=Integer.parseInt(array[3][1]);
int e=Integer.parseInt(array[4][1]);
int f=Integer.parseInt(array[5][1]);
int g=Integer.parseInt(array[6][1]);
int h=Integer.parseInt(array[7][1]);
int i=Integer.parseInt(array[8][1]);
int j=Integer.parseInt(array[9][1]);
if(number>a) return true;
if(number>b) return true;
if(number>c) return true;
if(number>d) return true;
if(number>e) return true;
if(number>f) return true;
if(number>g) return true;
if(number>h) return true;
if(number>i) return true;
if(number>j) return true;
【问题讨论】:
标签: java arrays loops parseint