博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
kotlin 或 运算_Kotlin程序对两个数字执行算术运算
阅读量:2531 次
发布时间:2019-05-11

本文共 1290 字,大约阅读时间需要 4 分钟。

kotlin 或 运算

Here, we are implementing a Kotlin program to perform various arithmetic operations on two numbers.

在这里,我们正在实现Kotlin程序,以对两个数字执行各种算术运算

Given two numbers a and b, we have to find addition, subtraction, multiplication, division, and remainder.

给定两个数字ab ,我们必须找到加法,减法,乘法,除法和余数。

Example:

例:

Input:    a = 13    b = 5    Output:    a + b = 18    a - b = 8    a * b = 65    a / b = 2    a % b = 3

在Kotlin中执行算术运算的程序 (Program to perform arithmetic operations in Kotlin)

package com.includehelp.basic// Main Method Entry Point of Programfun main(args:Array
){ val a = 13 val b = 5 val sum = a + b // Perform Addition val sub = a - b // Perform Subtraction val muti = a * b // Perform Multiplication val div = a / b // Perform Division val rem = a % b // Perform remainder // Print on Console println("Addison of $a and $b is : $sum") println("Subtraction of $a and $b is : $sub") println("Multiplication of $a and $b is: $muti") println("Division of $a and $b is : $div") println("Remainder of $a and $b is : $rem")}

Output

输出量

Addison of 13 and 5 is       : 18Subtraction of 13 and 5 is   : 8Multiplication of 13 and 5 is: 65Division of 13 and 5 is      : 2Remainder of 13 and 5 is     : 3

翻译自:

kotlin 或 运算

转载地址:http://zfazd.baihongyu.com/

你可能感兴趣的文章
学习笔记-模块之xml文件处理
查看>>
接口测试用例
查看>>
面试:用 Java 实现一个 Singleton 模式
查看>>
Sybase IQ导出文件的几种方式
查看>>
案例:手动输入一个字符串,打散放进一个列表,小写字母反序 大写字母保持不变...
查看>>
linux 系统下 tar 的压缩与解压缩命令
查看>>
阿里负载均衡,配置中间证书问题(在starcom申请免费DV ssl)
查看>>
转:How to force a wordbreaker to be used in Sharepoint Search
查看>>
MySQL存储过程定时任务
查看>>
Python中and(逻辑与)计算法则
查看>>
POJ 3267 The Cow Lexicon(动态规划)
查看>>
设计原理+设计模式
查看>>
音视频处理
查看>>
tomcat 7服务器跨域问题解决
查看>>
前台实现ajax 需注意的地方
查看>>
Jenkins安装配置
查看>>
个人工作总结05(第二阶段)
查看>>
Java clone() 浅拷贝 深拷贝
查看>>
深入理解Java虚拟机&运行时数据区
查看>>
02-环境搭建
查看>>