int x>0;cin>>x>>endl;if (x%2=0)
//得到以2为a1的等差数列,an为xcout<<"从1之n的偶数和为"<<x*(2+x)/4<<endlelse//得到以1为a1的等差数列,an为xcout<<"从1之n的奇数和为"<<(x+1)(1+x)/4<<endl;