1. java怎么打印
/* *组合 回溯 *a为源数据,调用时用f(a,0,"") */ void f(int[] a,int n,String v){ if(n==a.length){ System.out.println(v); }else{ f(a,n+1,v); f(a,n+1,v+","+a[n]); } }
2. JAVA怎么打印文字
想将信息打印到控制台上的话,直接用system.out.println()输出就行,没必要用日志来实现。
3. JAVA怎么打印99乘法表
public class multi {
public static void main(String[] args) {
//使用循环打印99乘法表
System.out.println("***使用循环打印99乘法表***");
for (int i = 1; i <= 9; i++) {
System.out.println("");
for (int j = 1; j <= i; j++) {
// System.out.print(i + "*" + j + "=" + i*j + "\t");
System.out.printf("%-10s",i + "*" + j + "=" + i*j ); //格式化打印流
}
}
}
}
4. java怎么打印对象
public static void recursive(List
try {
System.out.println(strList.get(index));
ss(strList, index - 1);
} catch (Exception e) {
return;
}
}
public static void main(String[] args) {
List
Scanner input = new Scanner(System.in);
for (int i = 0; i
list.add(input.next());
recursive(list, list.size() - 1);
}
5. java怎么打印三角形
Private Sub Command1_Click() n = 4 For i = 4 To 1 Step -1 For j = 1 To 4 - i Print " "; Next j For j = 1 To 2 * i - 1 Print Trim(Str(i)); Next j Print Next iEnd Sub
- 相关评论
- 我要评论
-