// page111.cpp : 定义控制台应用程序的入口点。
//C++ 面向对象程序设计
//累加10个负数
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int number ,sum = 0 , count = 0 ;
cout << " Enter 10 negative numbers:\n";
while( ++count <= 10)
{
cin >> number;
if(number >= 0)
{
cout << " ERROR: positive number "
<< " or zero was entered as the \n"
<< count << " the number !Input ends\n"
<< " with the "<< count << "the number .\n"
<< count << "the number was not added in .\n";
break ;
}
sum = sum + number;
}
cout << sum << " is the sum of the frist "
<< (count - 1)<< " numbers.\n";
cin >> number;
return 0;
}
--------------现在不知道怎么上传不了我的切图啦 ------------------------
难道是bug?