kotlin 查找id
A cylinder is a three-dimensional structure which has circular bases parallel to each other.
圆柱是具有彼此平行的圆形底的三维结构。
Formula to find area of a cylinder: 2*PI*(radius+height)
查找圆柱体面积的公式:2 * PI *(半径+高度)
Give radius and height, we have to find area of a cylinder.
给定半径和高度,我们必须找到圆柱体的面积。
Example:
例:
Input:
Radius = 5
Height = 7
Output:
Surface Area of Cylinder is :75.39822368615503
查找Kotlin圆柱体面积的程序 (Program to find area of a cylinder 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 Radius
print("Enter Radius of Cylinder : ")
val radius = scanner.nextDouble()
//Input Height
print("Enter Height of Cylinder : ")
val height = scanner.nextDouble()
//Cylinder Surface Area
val areaCylinder = 2*Math.PI*(radius+height)
//Print Area
println("Surface Area of Cylinder is :$areaCylinder")
}
Output
输出量
Run 1:
Enter Radius of Cylinder : 5
Enter Height of Cylinder : 7
Surface Area of Cylinder is :75.39822368615503
---
Run 2:
Enter Radius of Cylinder : 29
Enter Height of Cylinder : 4
Surface Area of Cylinder is :207.34511513692635
翻译自: https://www.includehelp.com/kotlin/find-area-of-a-cylinder.aspx
kotlin 查找id