// sample.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<iostream>
#include<valarray>
using namespace std;
void _tmain()
{
int firstNumber,secondNumber;
cout<<"First number _>";
cin>>firstNumber;
cout<<"Second numner _>";
cin>>secondNumber;
cout<<"The sum is:"<<(firstNumber+secondNumber)*(abs(firstNumber-secondNumber)+1)/2
<<endl;
}
//
#include "stdafx.h"
#include<iostream>
#include<valarray>
using namespace std;
void _tmain()
{
int firstNumber,secondNumber;
cout<<"First number _>";
cin>>firstNumber;
cout<<"Second numner _>";
cin>>secondNumber;
cout<<"The sum is:"<<(firstNumber+secondNumber)*(abs(firstNumber-secondNumber)+1)/2
<<endl;
}