📄 betweensum.cpp
字号:
#include <iostream>
int main()
{
using namespace std;
int lower;
int upper;
cout<<"Please input the lower:";
cin>>lower;
cout<<"Please input the upper:";
cin>>upper;
while(lower>upper)
{
cout<<"lower have to less than upper!please input again…"<<endl;
cout<<"Please input the lower:";
cin>>lower;
cout<<"Please input the upper:";
cin>>upper;
}
int sum=0;
for(;lower<=upper;lower++)
{
sum+=lower;
}
cout<<"result is:"<<sum<<endl;
system("Pause");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -