Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int wczytajLiczbe()
- {
- int a;
- int liczba;
- cin >> liczba;
- cout << "Podaj ja jeszcze raz: ";
- cin >> a;
- if ( a == liczba )
- {
- return (liczba);
- }
- else ( a != liczba );
- do
- {
- cout << "Podaj poprawna liczbe ";
- cin >> a;
- } while ( a != liczba );
- }
- int main()
- {
- cout << " Nasz program wczytuje liczby ze standardowego wejscia i zwraca podana wartosc " << endl;
- cout << "\nPodaj liczbe: ";
- int liczba = wczytajLiczbe();
- cout << "Podales liczbe: " << liczba << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement