Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string>
- #include <time.h>
- #include <windows.h>
- #include <conio.h>
- #include "parzyste.h"
- using namespace std;
- Parzyste::Parzyste(int nn, int ll_parzystych)
- {
- n = nn;
- l_parzystych = ll_parzystych;
- }
- Parzyste::~Parzyste()
- {
- cout<<endl<<"Trwa wylaczanie wszystkiego...";
- }
- void Parzyste::pWyciagnijIlosc()
- {
- cout<<"Ile liczb ma sie pojawic: ";
- cin >> n;
- }
- void Parzyste::pObliczIlosc()
- {
- for(int i=0;i<n;i++)
- {
- int liczba; //wczytujemy liczbe
- cin >> liczba;
- if(liczba % 2 == 0) //sprawdzamy czy parzysta
- {
- l_parzystych++;
- }
- }
- }
- void Parzyste::pPokazIlosc()
- {
- cout<<"Parzyste: "<<l_parzystych<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement