RosettaCodeData/Task/Arithmetic-Integer/Elena/arithmetic-integer.elena

16 lines
495 B
Plaintext

import system'math;
import extensions;
public program()
{
var a := console.loadLineTo(new Integer());
var b := console.loadLineTo(new Integer());
console.printLine(a," + ",b," = ",a + b);
console.printLine(a," - ",b," = ",a - b);
console.printLine(a," * ",b," = ",a * b);
console.printLine(a," / ",b," = ",a / b); // truncates towards 0
console.printLine(a," % ",b," = ",a.mod(b)); // matches sign of first operand
console.printLine(a," ^ ",b," = ",a ^ b);
}