palm0919 發表於 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 ;
    }
頁: [1]
查看完整版本: 階層

Checking the Pageranks