题目链接:http://ac.jobdu.com/problem.php?pid=1179
解题时间:2013/4/13
程序源码:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
long long y1,y2;
long long temp;
int i;
while(scanf("%d",&n)!=EOF)
{
y1=y2=0;
temp=1;
i=1;
while(i<=n)
{
temp*=i;
y1+=temp;
i++;
if(i<=n)
{
temp*=i;
y2+=temp;
i++;
}
}
printf("%lld %lld\n",y1,y2);
}
return 0;
}