您的位置:首页 > 编程语言 > Java开发

java语言程序设计第十版(Introduce to java) 课后习题 chapter6-6

2016-03-21 19:37 507 查看
java语言程序设计第十版(Introduce to java) 课后习题 chapter6-6

自己纯手工,欢迎讨论

package chapter6;

public class Test6 {

public static void main(String[] args) {

displayPattern(11);

}

public static void displayPattern(int n) {
int num = 1;
for (int i = n; i >= 1; i--) {
for (int j = 1; j < i; j++) {
System.out.print("\t");
}
for (int m = 1; m <= num; m++) {
System.out.print(m + "\t");
}
System.out.println();
num++;
}
}

}


) 课后习题

自己纯手工,欢迎讨论
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息