Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int liczba;
- cout << "Prosze podac liczbe calkowita: ";
- cin >> liczba;
- if(cin.good())
- cout << liczba << endl;
- else
- {
- cout << "Liczba nie zostala poprawnie wpisana" << endl;
- cin.clear(); // opuszcza flagę błędu w buforze
- cin.ignore(1000, '\n'); // czyści bufor zapisu
- cin >> liczba;
- cout << liczba << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement