Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Podaj liczbe calkowita: ";
- int liczba;
- cin >> liczba;
- while(cin.fail())
- {
- cout << "liczba nie zostala poprawnie wczytana. Wpisz ja jeszcze raz: " << endl;
- cin.clear(); // opuszcza flagฤ bลฤdu
- cin.ignore(1000, '\n'); // oczyszcza bufor wejลcia
- cin >> liczba;
- }
- cout << liczba << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement