编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习1
#include <iostream>
using namespace std;
int main()
{
int min,max;
cout<<"Enter the min: ";
cin>>min;
cout<<"Enter the max: ";
cin>>max;
int sum=0;
for(int i=min;i<=max;i++)
sum+=i;
cout<<"The sum from min to max: "<<sum<<endl;
system("pause");
return 0;
}