N的阶乘-加强版
Tag:
Background
In class, gauss learned to compute the factorial of n and showed off to his younger brother von neumann when he got home. In order not to make Gauss too complacent, Von Neumann asked his brother a question: "Since you will seek the factorial of N, then you can help me calculate 1! +2!-3!+4!-5!+……N!” . Now Gaussian is baffled. Smart, can you help him?
课堂上高斯学会了用计算机求出的阶乘,回到家后就对弟弟冯诺依曼炫耀起来。
为了不让高斯太自满,冯诺依曼给哥哥出了个问题“既然你会求的阶乘,那么你帮我算算”。这下可把高斯难住了,聪明的你能帮帮他吗?
Description
Fine out: 1!+2!-3!+4!-5!+……N!
求
Input
Enter an integer t (0 < t < = 20) in the first row to represent t groups of test data. The next line, a total of t positive integers n (0 < n < = 20).
第一行输入一个整数 ,代表有 组测试数据。
之后 1行,共个正整数。
Output
A total of T lines, one line and one integer, represent 1! +2! -3! +…..N! The value of.
共T行,一行一个整数,表示的值。
Input
Output
Limitation