kotlin 查找id_Kotlin程序查找圆柱体区域

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/543991.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

快速搭建 SpringCloud Alibaba Nacos 配置中心!

作者 | 磊哥来源 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;Spring Cloud Alibaba 是阿里巴巴提供的一站式微服务开发解决方案&#xff0c;目前已被 Spring Cloud 官方收录。而 Nacos 作…

c# datetime._C#| DateTime.TimeOfDay属性(带示例)

c# datetime.DateTime.TimeOfDay属性 (DateTime.TimeOfDay Property) DateTime.TimeOfDay Property is used to get the time of the day of this object. Its a GET property of DateTime class. DateTime.TimeOfDay属性用于获取该对象一天中的时间。 这是DateTime类的GET属性…

JSP 基础(一)

JavaServletPage(JSP) 一 JSP简介 Servlet的缺陷–Servlet的编码、部署和调试任务繁琐–生成动态网页繁琐&#xff0c;不利于项目分工为了弥补Servlet的这些缺陷&#xff0c;SUN公司在Servlet的基础上推出了JSP技术作为解决方案采用JSP技术编写动态页面 –由HTML语句和嵌套在其…

浅聊一下建表的15个小技巧

前言对于后端开发同学来说&#xff0c;访问数据库&#xff0c;是代码中必不可少的一个环节。系统中收集到用户的核心数据&#xff0c;为了安全性&#xff0c;我们一般会存储到数据库&#xff0c;比如&#xff1a;mysql&#xff0c;oracle等。后端开发的日常工作&#xff0c;需要…

c# datetime._C#| 带示例的DateTime.DayOfWeek属性

c# datetime.DateTime.DayOfWeek属性 (DateTime.DayOfWeek Property) DateTime.DayOfWeek Property is used to return the day of the week. DateTime.DayOfWeek属性用于返回星期几。 Syntax: 句法&#xff1a; DayOfWeek DateTime.DayOfWeek;Return value: 返回值&#xff…

JConsole的使用手册 JDK1.5(转)

一篇Sun项目主页上介绍JConsole使用的文章&#xff0c;前段时间性能测试的时候大概翻译了一下以便学习&#xff0c;今天整理一下发上来&#xff0c;有些地方也不知道怎么翻&#xff0c;就保留了原文&#xff0c;可能还好理解点&#xff0c;呵呵&#xff0c;水平有限&#xff0c…

一文快速上手 Nacos 注册中心+配置中心!

作者 | 磊哥来源 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;Spring Cloud Alibaba 是阿里巴巴提供的一站式微服务开发解决方案&#xff0c;目前已被 Spring Cloud 官方收录。而 Nacos 作…

所有子序列的逆序对总和_一个数字的所有子串的总和

所有子序列的逆序对总和Problem statement: 问题陈述&#xff1a; Given an integer, S represented as a string, get the sum of all possible substrings of this string. 给定一个以字符串形式表示的整数S &#xff0c;得到该字符串所有可能的子字符串的和 。 Input: 输入…

synchronized:使用不规范,老板泪两行!

线程安全问题一直是系统亘古不变的痛点。这不&#xff0c;最近在项目中发了一个错误使用线程同步的案例。表面上看已经使用了同步机制&#xff0c;一切岁月静好&#xff0c;但实际上线程同步却毫无作用。关于线程安全的问题&#xff0c;基本上就是在挖坑与填坑之间博弈&#xf…

SQL --运算符

2019独角兽企业重金招聘Python工程师标准>>> 一、<> (安全等于运算符) mysql中的 、<>或!运算符&#xff0c;相信大家已经很清楚了。今天看到了<>这个运算符&#xff0c;记录下来。 1><>和号的相同点 他们都是两个值比较符&#xff0c;相…

linux 文件浏览器_浏览Linux文件系统

linux 文件浏览器你为什么要学习&#xff1f; (Why would you want to learn?) Linux is probably the most used operating system when it comes to development. For a developer, Linux provides all the required tools. Learning how to navigate the Linux file system…

@Autowired 和 @Resource 的 5 点区别!

作者 | 磊哥来源 | Java面试真题解析&#xff08;ID&#xff1a;aimianshi666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;Autowired 和 Resource 都是 Spring/Spring Boot 项目中&#xff0c;用来进行依赖注入的注解。它们都提供了将依赖对…

rsync同步数据到内网

最近公司要求将IDC的APP日志备份到公司办公网内部&#xff0c;思前想后&#xff0c;结合以前学过的知识&#xff0c;决定用rsync直接推送&#xff0c;即从APP服务器上直接将日志推送到公司内网。这样避免了在生产服务器上额外安装更多软件而且只需要进行简单的配置&#xff0c;…

sql 更改列数据类型_SQL查询更改列数据类型

sql 更改列数据类型Datatype of the column in SQL can be changed using the ALTER TABLE command. It can also be used to ADD, DELETE or MODIFY columns in already existing tables. It can also be used to ADD or DROP constraints in the SQL database. 可以使用ALTER…

SpringBoot 时间格式化的 5 种实现方法!

作者 | 王磊来源 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;在我们日常工作中&#xff0c;时间格式化是一件经常遇到的事儿&#xff0c;所以本文我们就来盘点一下 Spring Boot 中时间格…

java 枚举 示例_Java枚举name()方法及示例

java 枚举 示例枚举类name()方法 (Enum Class name() method) name() method is available in java.lang package. name()方法在java.lang包中可用。 name() method is used to return the name of this enum constants as it is declared in its enum prototype or declaratio…

SpringBoot 解决跨域问题的 5 种方案!

作者 | 磊哥来源 | Java面试真题解析&#xff08;ID&#xff1a;aimianshi666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;跨域问题指的是不同站点之间&#xff0c;使用 ajax 无法相互调用的问题。跨域问题本质是浏览器的一种保护机制&#…

Java 中的 Lombok 到底能不能用?

一、摘要Java&#xff0c;作为一款非常热门的编程语言&#xff0c;尽管它有着非常丰富的语言特性&#xff0c;完全面向对象编程&#xff0c;编程高度规范化&#xff0c;但是也有一个最受大家诟病的一个缺点&#xff1a;啰嗦&#xff0c;尤其是当你开发了很多年之后&#xff0c;…

旅行商问题

旅行商问题 (Travelling Salesman problem) This problem can be stated as- "Given n number of cities and a travelling salesman has to visit each city. Then we have to find the shortest tour so that the travelling salesman can visit each and every city on…

清除元素中的子元素html_HTML中的元素简介

清除元素中的子元素htmlAn element is a fundamental component that is used to develop web pages. Generally an element as two components: a starting tag and a closing tag. The content is added in between the starting and closing tags. The ending tag is the sa…