VB.NET 算术表达式求值
问题描述:
VB.NET 算术表达式求值
求下列算术表达式的值.已知x = 2.5 :a = 7 :y = 4.7.
(1)x+a Mod 3 * (Int(x+y)Mod 2)/4
(2)CSng(a + 3)/2+Int(x) Mod Int(y)
答
1)x+a Mod 3 * (Int(x+y)Mod 2)/4=
2.5 + 7 Mod 3 *(int(2.5+4.7) Mod 2)/4
=9.5 mod 3*3/4
= 9.5 mod 2
=4