#include<stdio.h>
void func(int n, int *p, int *f);
int main(void)
{
int n, S=0, Factorial=1;
printf("please input data: \n"); func(n, &S, &Factorial);
printf("n=%d 和%d 積%d\n",n
, S
, Factorial
); return 0;
}
void func(int n, int *p, int *f)
{
int i;
for(i=1;i<=n;++i)
{
*p=*p+i;
*f=*f*i;
}
}
I2luY2x1ZGU8c3RkaW8uaD4Kdm9pZCBmdW5jKGludCBuLCBpbnQgKnAsIGludCAqZik7CmludCBtYWluKHZvaWQpCnsKIGludCBuLCBTPTAsIEZhY3RvcmlhbD0xOwogcHJpbnRmKCJwbGVhc2UgaW5wdXQgZGF0YTogXG4iKTsKIHNjYW5mKCIlZCIsJm4pOwogZnVuYyhuLCAmUywgJkZhY3RvcmlhbCk7CiBwcmludGYoIm49JWQg5ZKMJWQg56mNJWRcbiIsbiwgUywgRmFjdG9yaWFsKTsKIHJldHVybiAwOwp9Cgp2b2lkIGZ1bmMoaW50IG4sIGludCAqcCwgaW50ICpmKQp7CiBpbnQgaTsKIGZvcihpPTE7aTw9bjsrK2kpCiB7CiAgKnA9KnAraTsKICAqZj0qZippOwogfQp9Cg==