[C++Primer]練習1.9
313 ワード
#include
using std::cin;
using std::cout;
using std::endl;
int main() {
int start = 50, sum = 0;
while (start <= 100) {
sum += start;
++start;
}
cout << "sum of 50 to 100 inclusive is " << sum << endl;
}