1 条题解

  • 0
    @ 2025-11-30 16:24:22

    C++ :

    #include <iostream>
    using namespace std;
    
    int main() {
        int n;
        cin >> n;
        
        for (int i = 1; i <= n; ++i) {
            int factorial = 1;
            for (int j = 1; j <= i; ++j) {
                factorial *= j;
            }
            cout << i << "! = " << factorial << "\n";
        }
        
        return 0;
    }
    
    • 1

    信息

    ID
    636
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者