gcc -E test.c -o test.i
gcc -s test.i -o test.s
gcc -c test.s -o test.o
gcc test.o -c test
gcc -c test.c -o test.o gcc test.o -o test # 或者 gcc test.c -o test # 最后执行 ./test
#include<stdio.h> int main() { int i, j; long sum = 0; for (i = 1; i <= 10; i++) { int total = 1; for (j = 1; j <= i; j++) total = total * j; sum = sum + total; } printf("1! + 2! + 3! + ... + 10! = %ld\n", sum); return 0; }