?? factory01.cpp
字號:
//=====================================
// title: 階乘(循環方法Iterative Implementation)
// author: cjj
// date: 2007-09-29
//=====================================
#include <iostream>
using namespace std;
int main()
{
for (int n; cin >> n;)
{
int factory = 1;
if (n == 0)
cout << n << "! = " << 1 << endl;
else
{
for (int i = 1; i <= n; i++)
{
factory *= i;
}
cout << n << "! = " << factory << endl;
}
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -