函数可以没有返回值案例,编写一个函数,从终端输入一个整数,打印出对应的金字塔 import scala.io.StdIn object work02 { def main(args: Array[String]): Unit = { println("请输入一个数") var num:Int=StdIn.readInt() val pige=(num:Int)=>{ for (i<-1 to num){ for (j<-1 to num-i){ print("
*** 1. 终端打开.bash_profile文件 ***open ~/.bash_profile *** 2. .bash_profile文件内容 ***# Setting PATH for Python 3.5# The original version is saved in .bash_profile.pysavePATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"export PATH **
一:将键盘输入的数存到数组中,数组长度未知 public class Test{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String[] num = null; num = sc.nextLine().split(" "); int[] number = new int[num.length]; for(int i = 0; i < number.length; i