Euphoria - 算术运算符



以下简单示例程序演示了算术运算符。复制并粘贴 test.ex 文件中的 Euphoria 程序,然后运行此程序 −

#!/home/euphoria-4.0b2/bin/eui

integer a = 10
integer b = 20

printf(1, "a + b = %d\n" , (a + b) )
printf(1, "a - b = %d\n" , (a - b) )
printf(1, "a * b = %d\n" , (a * b) )
printf(1, "b / a = %d\n" , (b / a) )
printf(1, "+a   = %d\n" ,  (+a) )
printf(1, "-a   = %d\n" ,  (-a) )

这将生成以下结果 −

a + b = 30
a - b = -10
a * b = 200
b / a = 2
+a   = 10
-a   = -10
euphoria_operators.htm
广告