2.1 C2.2 anInt 、i1 、thing13 System.out.println("" + 11*5);5 懒得做6 "roar"7 字符串连接
字符替换
去除字符串首位空格
(不知道)
8 1. 不理解题意
2. 6
3. 不理解题意
4. "Sun Valley"9 for(int i = 0; i < 4; i++) {
for(int j = i; j < i+5; j++)
System.out.print(""+j);
System.out.println("");
}
=======================================
不知道对不对
字符替换
去除字符串首位空格
(不知道)
8 1. 不理解题意
2. 6
3. 不理解题意
4. "Sun Valley"9 for(int i = 0; i < 4; i++) {
for(int j = i; j < i+5; j++)
System.out.print(""+j);
System.out.println("");
}
=======================================
不知道对不对
public int add(int m){
if(m==1) return 1;
return m+add(m-1);
}
5. int[] w={32,87,3,589,12,1076,2000,8,622,127};
int temp;
for(int i=0;i<w.length;i++){
for(int j=i+1;j<w.length;j++){
if(w[j]<w[i]){
temp=w[i];
w[i]=w[j];
w[j]=temp;
}
}
}
for(int i=0;i<w.length;i++){
System.out.println(w[i]);
}