查看: 1900|回覆: 0

[原創] 階層

[複製鏈接]
發表於 2007-5-18 11:52:45 | 顯示全部樓層 |閲讀模式
#include<iostream>
using namespace std ;
long double foct(int a)
    {if(a==1)
            return 1;
            else return(a+foct(a-1));}
            int main()
            {
                int x;
                while(true){
                            cout<<"輸入一個數質出他的遞接數值(<170)"<<endl;
                            cin>>x;
                            if(x==0)break;
                            cout<<x<<"!總和"<<foct(x);}
                           
               
    system("PAUSE") ;
    return 0 ;
    }
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:[email protected]

Powered by Discuz! X5.0 Licensed © 2001-2026 Discuz! Team.

在本版發帖
关注公众号
返回頂部