标签:nbsp next print blog while循环 author new scan 循环
import java.util.Scanner; /** * @author 蓝色以太 while循环输出如下语句: 2*5=10 4*10=40 6*15=90 …… ?*100=? */ public class While { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("请输入层高:"); int num = sc.nextInt(); int i = 1; while (i <= num) { System.out.println(i * 2 + "*" + i * 5 + "=" + (i * 2 * i * 5)); i++; } } }
while循环输出如下语句: 2*5=10 4*10=40 6*15=90 …… ?*100=?
标签:nbsp next print blog while循环 author new scan 循环
原文地址:http://www.cnblogs.com/lanseyitai1224/p/7011507.html