Advertisement
scottish_esquire

Kotlin - Сумма 5 чисел

Jan 1st, 2023
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.52 KB | None | 0 0
  1. fun my_first_function(a1: Int, a2: Int, a3: Int, a4: Int, a5: Int): Int {
  2.    var summation = a1 + a2 + a3 + a4 + a5;
  3.    return summation;
  4. }
  5.  
  6. fun main() {
  7.     var a1: Int;
  8.     var a2: Int;
  9.     var a3: Int;
  10.     var a4: Int;
  11.     var a5: Int;
  12.     a1 = readLine()!!.toInt();
  13.     a2 = readLine()!!.toInt();
  14.     a3 = readLine()!!.toInt();
  15.     a4 = readLine()!!.toInt();
  16.     a5 = readLine()!!.toInt();
  17.     var res: Int = my_first_function(a1, a2, a3, a4, a5);
  18.     println("Сумма 5 чисел равна $res.");
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement