杭电ACM1001

  • A+
所属分类:ACM

杭电ACM1001

#include <iostream>
int main()
{
 using namespace std;
 long int n,m;
 long int s;
 while (cin >> n)
 {
  if (n%2 == 0)
  {
   s = n/2*(n+1);
  }
  else
  {
   s = (n+1)/2*n;
  }
  cout  << s << endl << endl;
 }
 return 0;
}
百分购

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: