page117

// 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-- 有人看见 说一声--谢谢---教我怎么传图片

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值