RosettaCodeData/Task/Arithmetic-Integer/Nemerle/arithmetic-integer.nemerle

18 lines
587 B
Plaintext

using System;
class Program
{
static Main(args : array[string]) : void
{
def a = Convert.ToInt32(args[0]);
def b = Convert.ToInt32(args[1]);
Console.WriteLine("{0} + {1} = {2}", a, b, a + b);
Console.WriteLine("{0} - {1} = {2}", a, b, a - b);
Console.WriteLine("{0} * {1} = {2}", a, b, a * b);
Console.WriteLine("{0} / {1} = {2}", a, b, a / b); // truncates towards 0
Console.WriteLine("{0} % {1} = {2}", a, b, a % b); // matches sign of first operand
Console.WriteLine("{0} ** {1} = {2}", a, b, a ** b);
}
}