请看看我的代码:
#include <iostream>
using std::cin; // I would like to make cin object available
using std::cout; // I would like to make cout object available in source code
using std::get; // I would like to make cin.get() available
using std::fail; // I would like to make cin.fail() available
factorial(int number);
int main()
{
int closer;
cin >> closer;
while (!cin.fail())
{
factorial(closer); // it's obvious going by the name, It's factorial function
cin >> closer;
}
}
factorial(int number)
{ …Run Code Online (Sandbox Code Playgroud) c++ ×1