Java 实例 – 打印平行四边形

Java 教程 · 2019-02-10 19:27:17

输出平行四边形。

实例

public class Parallelogram { public static void main(String[] args) { //外层循环 每次打出一个* for (int i = 1; i <=5; i++) { //填充空格 for (int j = 1; j <= 5 - i; j++) { System.out.print(" "); } //内层循环 每次打印一个* for (int k = 1; k <= 5; k++) { System.out.print("*"); } System.out.println(); } } }

输出结果:

    *****
   *****
  *****
 *****
*****

点击查看所有 Java 教程 文章: https://codercto.com/courses/l/12.html

查看所有标签

Game Engine Architecture, Second Edition

Game Engine Architecture, Second Edition

Jason Gregory / A K Peters/CRC Press / 2014-8-15 / USD 69.95

A 2010 CHOICE outstanding academic title, this updated book covers the theory and practice of game engine software development. It explains practical concepts and techniques used by real game studios,......一起来看看 《Game Engine Architecture, Second Edition》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具