国开 / 面向对象程序设计
public class XXK4 {
public static void main(String[] args) {
String []a={"xxk","weirong","xucong","xuxiaohua","baojuan"};
int m=0;
for(int i=0; i
int n=a[i].length();
if(n>m) m=n;
}
System.out.println("m="+m);
}
}
m=9
m=10
public static void main(String[] args) {
String []a={"xxk","weirong","xucong","xuxiaohua","baojuan"};
int m=0;
for(int i=0; i
int n=a[i].length();
if(n>m) m=n;
}
System.out.println("m="+m);
}
}
m=9
m=10
参考答案:
佳题速递: