首页 > 学院 > 开发设计 > 正文

泳池迷宫

2019-11-08 03:06:08
字体:
来源:转载
供稿:网友

看上去比较简单的题目,不注意细节还真的挺有难度的 源码

public class PoolPuzzleOne { public static void main(String[] args) { // TODO Auto-generated method stub int x = 0; while(x < 4){ System.out.PRint("a"); if (x < 1) { System.out.print(" "); } System.out.print("n"); if (x > 1) { System.out.print(" oyster"); x = x + 2; } if (x == 1) { System.out.print("noys"); } if (x < 1) { System.out.print("oise"); } System.out.println(""); x = x + 1; } }}

运行结果: 这里写图片描述


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表