freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/rosetta-code/babbage-problem.chinese.md

1.7 KiB
Raw Blame History

title id challengeType videoUrl localeTitle
Babbage problem 594db4d0dedb4c06a2a4cefd 5 巴贝奇问题

Description

Charles Babbage ,展望他的分析引擎能解决的各种问题,给出了这个例子:

什么是正方形以数字269,696结尾的最小正整数

- 巴贝奇致鲍登勋爵的信1837年;见Hollingdale和Tootill 电子计算机 第二版1970年p。 125。

他认为答案可能是99,736其平方是9,947,269,696;但他无法确定。

任务是找出巴贝奇是否有正确的答案。

实现一个函数来返回满足Babbage问题的最小整数。如果巴贝奇是对的返回巴贝奇的号码。

Instructions

Tests

tests:
  - text: <code>babbage</code>是一种功能。
    testString: 'assert(typeof babbage === "function", "<code>babbage</code> is a function.");'
  - text: '<code>babbage(99736, 269696)</code>不应该返回99736答案较小。'
    testString: 'assert.equal(babbage(babbageAns, endDigits), answer, "<code>babbage(99736, 269696)</code> should not return 99736 (there is a smaller answer).");'

Challenge Seed

function babbage (babbageNum, endDigits) {
  // Good luck!
  return true;
}

After Test

console.info('after the test');

Solution

// solution required