Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #include <iostream>
  2. int main ()
  3. {
  4. int a;
  5. float b;
  6. long long c;
  7.  
  8. std::cout << "podaj liczbe calkowita.";
  9. std::cin >> a;
  10. std::cout << "Czy udalo sie wczytac? " << std::cin.good() << std::endl;
  11. std::cin.clear();
  12. std::cin.sync();
  13.  
  14. std::cout << "podaj liczbe rzeczywista.";
  15. std::cin >> b;
  16. std::cout << "Czy udalo sie wczytac? " << std::cin.good() << std::endl;
  17. std::cin.clear();
  18. std::cin.sync();
  19.  
  20. std::cout << "podaj dowolna liczbe rzeczywista.";
  21. std::cin >> c;
  22. std::cout << "Czy udalo sie wczytac? " << std::cin.good() << std::endl;
  23. std::cin.clear();
  24. std::cin.sync();
  25.  
  26. std::cout << "Liczba a = " << a << std::endl;
  27. bool atak = std::cin.good();
  28. bool anie = std::cin.fail();
  29. std::cout << "Liczba b = " << b << std::endl;
  30. bool btak = std::cin.good();
  31. bool bnie = std::cin.fail();
  32. std::cout << "Liczba c = " << c << std::endl;
  33. bool ctak = std::cin.good();
  34. bool cnie = std::cin.fail();
  35. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement