twitter


#include <cstdlib>
#include <iostream>
#define SENTINEL 0
#define NUM_MONTHS 12

using namespace std;

int main(int argc, char *argv[])
{
    int m, mem_sight,sightings;
   
    cout<<"BALD EAGLE SIGHTINGS"<<endl;
    cout<<endl;
    for(m=1;m<=NUM_MONTHS;m++){
    sightings=0;
    cin>>mem_sight;
    while(mem_sight != SENTINEL){
                   if(mem_sight>=0)
                   sightings+= mem_sight;
                   else
                   cout<<"Warning negative count ingores"<<mem_sight<<endl;
                   }
                   cout<<"month = "<<m<<sightings;
                   }
    system("PAUSE");
    return EXIT_SUCCESS;
}

Hasilnya

0 komentar:

Posting Komentar