Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Arithmetic-Integer/Crystal/arithmetic-integer.crystal
Normal file
10
Task/Arithmetic-Integer/Crystal/arithmetic-integer.crystal
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