#include <stdio.h>
/* 计算一个数的立方 */
int cube(const int x) {
return x * x * x;
}
/* 计算一个数的阶乘 */
int factorial(const int x) {
int rst = 1;
for (; x > 0; --x) { //[Error] decrement of read-only parameter 'x'
rst *= x;
}
return rst;
}
int main(void) {
const int v = 7;
printf("cube(7) = %d\n", cube(v));
printf("factorial(7) = %d\n", factorial(v));
return 0;
}
guozhchun