写方法1+2-3+4-5+6-7...i注意性能
private static int GetValue(int num)
{
if(num%2==0)
{
return 1-(num/2)+1+num;
}
else
{
return 1-(num/2);
}
}
private static int GetValue(int num)
{
if(num%2==0)
{
return 1-(num/2)+1+num;
}
else
{
return 1-(num/2);
}
}