2016年11月5日 星期六

TIOJ 1180 - 社員.爆炸

http://tioj.infor.org/problems/1180

...我也不知道為什麼我要建表(?



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include<iostream>
using namespace std;
int n,a,i,c;
string m[14];
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    cin>>n;
    m[0]="1";
    m[1]="1";
    m[2]="2";
    m[3]="6";
    m[4]="24";
    m[5]="120";
    m[6]="720";
    m[7]="5040";
    m[8]="40320";
    m[9]="362880";
    m[10]="3628800";
    m[11]="39916800";
    m[12]="479001600";
    m[13]="6227020800";
    for(c=1;c<=n;c++){
        cin>>a;
        cout<<"Case #"<<c<<":\n";
        for(i=0;i<=a;i++){
            cout<<"TFCIS"<<i<<"="<<m[i]<<"\n";
        }
    }
}

沒有留言:

張貼留言