Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
Input
One N in one line, process to the end of file.
Output
For each N, output N! in one line.
Sample Input
1
2
3
Sample Output
1
2
6
一看到题目就想到用高精度乘法,用数组模拟小学学过的乘法,各位对齐,再两两相乘,这里可以变一下,没必要把数都拆成一个一个,比如一个数要乘1000,没必要拆成1 0 0 0,可以没一位乘以1000,不会超范围,这样可以省好多事。
View Code