日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

kotlin 或 运算_Kotlin程序对两个数字执行算术运算

發布時間:2023/12/1 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 kotlin 或 运算_Kotlin程序对两个数字执行算术运算 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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 = 13b = 5Output:a + b = 18a - b = 8a * b = 65a / b = 2a % b = 3

在Kotlin中執行算術運算的程序 (Program to perform arithmetic operations in Kotlin)

package com.includehelp.basic// Main Method Entry Point of Program fun main(args:Array<String>){val a = 13val b = 5val sum = a + b // Perform Additionval sub = a - b // Perform Subtractionval muti = a * b // Perform Multiplicationval div = a / b // Perform Divisionval rem = a % b // Perform remainder// Print on Consoleprintln("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 : 18 Subtraction of 13 and 5 is : 8 Multiplication of 13 and 5 is: 65 Division of 13 and 5 is : 2 Remainder of 13 and 5 is : 3

翻譯自: https://www.includehelp.com/kotlin/perform-arithmetic-operations-on-two-numbers.aspx

kotlin 或 運算

總結

以上是生活随笔為你收集整理的kotlin 或 运算_Kotlin程序对两个数字执行算术运算的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。