Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <sstream>
- #include <cctype>
- using namespace std;
- int main(){
- int x;
- while(1){
- cout << "Iveskite skaiciu: ";
- cin >> x;
- char c = cin.get();
- if(cin.fail() || (c != '\n')){
- cout << "Blogas ivedimas!" << endl;
- cin.clear();
- cin.ignore(1024, '\n');
- } else
- break;
- }
- // x yra geras
- cout << "Tu ivedei " << x << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement