c++基础语言----1.8 求n的阶乘

From , 4 Years ago, written in C++, viewed 53 times.
URL https://pastebin.vip/view/aebf7782
  1. //***********************************
  2. //功能:求n!
  3. //日期:2016年3月15日
  4. //作者:Ryan2019
  5. //***********************************
  6. #include <iostream>
  7. using namespace std;
  8. int main()
  9. {
  10.         int n,m=1,i;
  11.         cout<<"请输入n:";
  12.         cin>>n;
  13.         i=1;
  14.  
  15.  
  16.         for(;i<=n;i++)
  17.         {
  18.                 m=m*i;
  19.         }
  20.  
  21.         cout<<"n!="<<m<<endl;
  22.  
  23.         return 0;
  24. }

Reply to "c++基础语言----1.8 求n的阶乘"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website