kotlin 查找id_Kotlin程序查找圆柱体区域
生活随笔
收集整理的這篇文章主要介紹了
kotlin 查找id_Kotlin程序查找圆柱体区域
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
kotlin 查找id
A cylinder is a three-dimensional structure which has circular bases parallel to each other.
圓柱是具有彼此平行的圓形底的三維結(jié)構(gòu)。
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 = 5Height = 7Output:Surface Area of Cylinder is :75.39822368615503查找Kotlin圓柱體面積的程序 (Program to find area of a cylinder in Kotlin)
package com.includehelpimport java.util.*//Main Function , Entry point of Program fun main(args: Array<String>) {//Input Streamval scanner = Scanner(System.`in`)//Input Radiusprint("Enter Radius of Cylinder : ")val radius = scanner.nextDouble()//Input Heightprint("Enter Height of Cylinder : ")val height = scanner.nextDouble()//Cylinder Surface Areaval areaCylinder = 2*Math.PI*(radius+height)//Print Areaprintln("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
總結(jié)
以上是生活随笔為你收集整理的kotlin 查找id_Kotlin程序查找圆柱体区域的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java npm install_npm
- 下一篇: ipv6寻址_什么是IPV4寻址?