Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
10
Task/Arithmetic-Integer/Crystal/arithmetic-integer.cr
Normal file
10
Task/Arithmetic-Integer/Crystal/arithmetic-integer.cr
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
a = gets.not_nil!.to_i64
|
||||
b = gets.not_nil!.to_i64
|
||||
|
||||
puts "Sum: #{a + b}"
|
||||
puts "Difference: #{a - b}"
|
||||
puts "Product: #{a * b}"
|
||||
puts "Quotient (float division): #{a / b}" # / always returns a float.
|
||||
puts "Quotient (floor division): #{a // b}"
|
||||
puts "Remainder: #{a % b}" # Sign of remainder matches that of the second operand (b).
|
||||
puts "Power: #{a ** b}" # Integers can only be raised to a positive exponent.
|
||||
Loading…
Add table
Add a link
Reference in a new issue