kotlin 查找id
Formula to find area of Parallelogram: area = base*height
查找平行四边形面积的公式: area = base * height
Given the value of base and height, we have to find the area of Parallelogram.
给定基础和高度的值,我们必须找到平行四边形的面积。
Example:
例:
Input:
base = 5
height = 8
Output:
area = 40.0
程序在Kotlin中查找平行四边形的区域 (Program to find area of Parallelogram in Kotlin)
package com.includehelp
import java.util.*
//Main Function , Entry point of Program
fun main(args: Array<String>) {
//Input Stream
val scanner = Scanner(System.`in`)
//Input Base of Parallelogram
print("Enter Parallelogram Base : ")
val b = scanner.nextDouble()
//Input Height of Parallelogram
print("Enter Parallelogram Height : ")
val h = scanner.nextDouble()
//Calculate Area of Parallelogram
val areaParallelogram = b * h
//Print Area
println("Area of Parallelogram is :$areaParallelogram")
}
Output
输出量
Run 1:
Enter Parallelogram Base : 5
Enter Parallelogram Height : 8
Area of Parallelogram is :40.0
---
Run 2:
Enter Parallelogram Base : 5.7
Enter Parallelogram Height : 3
Area of Parallelogram is :17.1
翻译自: https://www.includehelp.com/kotlin/find-area-of-parallelogram.aspx
kotlin 查找id