// page117.cpp : 定义控制台应用程序的入口点。
//C++面向对象程序设计
//计算路劲秃鹰产卵总数
//由保护区的所有动物保护学者统计
#include "stdafx.h"
#include <iostream>
using namespace std ;
int main()
{
cout << " This program tallies conservationist reports\n"
<< " on the green-necked vulture .\n"
<< " Each conservationist`s report consists of \n"
<< " a list of numbers . Each number is the countof \n "
<< " the egggs obxerved in one"
<< " green-necked vulture nest .\n"
<< " This progeam then tallies "
<< " the total number of eggs .\n";
int number_of_reports;
cout << " How many conservation reports are there ?";
cin >> number_of_reports;
int grand_total =0 , subtotal ,count ;
for (count = 1 ; count <=number_of_reports ; count ++)
{
cout << endl << " Enter the report of "
<< "conservtionist number " << count << endl;
cout << " Enter the number of eggs in each nest .\n"
<< " Place a negative inter at the end of your list .\n";
subtotal = 0 ;
int next ;
cin >> next;
while ( next >= 0 )
{
subtotal = subtotal + next;
cin >> next ;
}
cout << " Total edd cout for conservationist"
<< " number"<< count << " is"
<<subtotal <<endl;
grand_total = grand_total +subtotal ;
}
cout << endl << "Total egg count for all reports = "
<< grand_total <<endl;
cin >> count;
return 0 ;
}
------------------------还是传不上我的图------------csdn-- 有人看见 说一声--谢谢---教我怎么传图片