柠檬试题库
search
首页 计算机 公务员 驾照 关于

设a、b都是自然数,为求a除以b的余数,某人编写了以下函数:Function fun(a As Integer,b As Integer) While a>b a=a-b Wend fun=aEnd Function在调试时发现函数是错误的。为使函数能产生正确的返回值,应做的修改是( )。


  • A.把a=a-b改为a=b-a
  • B.把 a=a-b 改为a=a\b
  • C.把While a>b 改为While a<b
  • D.把While a>b 改为While a>=b
热度🔥221
参考答案:D
解析:打开微信小程序查看本题解析