\n,\t的使用和区别

时间:2021-08-20 15:33:48   收藏:0   阅读:9

技术分享图片

 

例如:

public class ForWhileDemo04 {
public static void main(String[] args) {
//输出99乘法表
for(int i=1;i<=9;i++){
for (int j =1; j <=i; j++) {
System.out.print(j + "*" + i +"="+(i * j) + "\t");
}
System.out.println();

}
//print输出完不会换行
//println输出完会换行

}
}

技术分享图片

 

原文:https://www.cnblogs.com/myjhappystudy/p/15165944.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!