Advertisement
Guest User

Untitled

a guest
Oct 8th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.     float liczba;
  6.     bool err = false;
  7.     do{
  8.         cout << "podaj liczbe :" << endl;
  9.         cin >> liczba;
  10.         if(cin.fail()){
  11.             err = true;
  12.         }else{
  13.             cout << liczba;
  14.         };
  15.         cin.clear();
  16.  
  17.     }while(!err);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement