//hdu2520
#include <iostream>
using namespace std;
int main()
{
long t, v, s, i;
int T;
cin >> T;
while(T--)
{
cin >> t;
v = s = 1;
i = t - 1;
while(i--)
{
v += 2;
s += v;
}
cout << s % 10000 <<endl;
}
return 0;
}
本文提供了一个解决HDU2520问题的C++代码实现方案,该问题涉及通过迭代计算来求解特定数学序列的末四位数。程序使用了基本的循环结构与算术运算。
202

被折叠的 条评论
为什么被折叠?



