Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

テストなので返信無用です。 #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

IamWozniak
Copy link

@IamWozniak IamWozniak commented Oct 31, 2017

'use strict';
/**

  • 与えられた自然数の階乗を返す
  • 階乗とは、1からその与えられた自然数までの数をすべてかけたものです
  • @param {Number} n
  • @returns {Number}
    /
    function factorial(n) {
    let result = 1;
    for(i=1;i<=n;i++){
    result=result
    i;
    }
    return result;
    }
    const assert = require('assert');
    assert.equal(factorial(1), 1, 1の階乗は1ですが、実際は${factorial(1) }でした);
    assert.equal(factorial(2), 2, 2の階乗は2ですが、実際は${factorial(2) }でした);
    assert.equal(factorial(3), 6, 3の階乗は6ですが、実際は${factorial(3) }でした);
    assert.equal(factorial(10), 3628800, 10の階乗は3628800ですが、実際は${factorial(10) }でした);
    console.log('すべてのテストを通過しました');

@fjnok
Copy link

fjnok commented Apr 16, 2020

njou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants