设钱数为x,人数为y if y<x then msgbox "不可以平均分配" if y=x then msgbox "刚好一人一份" if y>x then if (x mod y) then msgbox "平均分配" else msgbox "不能平均分配" end if end if 当然,看你分配的钱是以什么为单位的,比如元,角,分,相应乘以10,100即可。
写了个子程序给你,绝对可以用的,调用方法: call 分钱 3,6Sub 分钱(人数 as long, 钱 as long) 钱=钱*100 if (钱\人数)*人数=钱 then MsgBox "共产主义时代来临了!" else MsgBox "分赃不均啊!" endif end sub
if y<x then msgbox "不可以平均分配"
if y=x then msgbox "刚好一人一份"
if y>x then
if (x mod y) then
msgbox "平均分配"
else
msgbox "不能平均分配"
end if
end if
当然,看你分配的钱是以什么为单位的,比如元,角,分,相应乘以10,100即可。
call 分钱 3,6Sub 分钱(人数 as long, 钱 as long)
钱=钱*100
if (钱\人数)*人数=钱 then
MsgBox "共产主义时代来临了!"
else
MsgBox "分赃不均啊!"
endif
end sub