hdu 2114

感觉这题好典型啊。。。第一点要注意的是求前N个数立方和的公式,第二点要注意输出格。一定要好好看哦。。。这个输出我还是第一次学到、、

代码如下:

#include"stdio.h"

int main( )
{
    __int64 ans,n;
    while(~scanf("%I64d",&n))
    {
        ans=((n*(n+1)/2)%10000)*((n*(n+1)/2)%10000)%10000;
        printf("%04I64d\n",ans);
    }
    return 0;
}
原文地址:https://www.cnblogs.com/chaosheng/p/2458705.html