Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool sprawdz(int bufor_, int liczba_)
- {
- if (bufor_ != 42 && liczba_ == 42)
- return true;
- else false;
- }
- int main()
- {
- int licznik = 0, liczba, bufor;
- //cout << "Podaj liczby:\n";
- cin >> liczba;
- bufor = liczba;
- if (sprawdz(bufor, liczba) == true)
- ++licznik;
- cout << liczba << endl;
- while (licznik < 3)
- {
- cin >> liczba;
- cout << liczba << endl;
- if (sprawdz(bufor, liczba) == true)
- ++licznik;
- bufor = liczba;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement