编程菜鸟的日记-初学尝试编程-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;
}

 

posted @ 2013-11-26 12:36  编程的爬行者  阅读(102)  评论(0编辑  收藏  举报