Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main ()
- {
- int a;
- float b;
- long long c;
- std::cout << "podaj liczbe calkowita.";
- std::cin >> a;
- std::cout << "Czy udalo sie wczytac? " << std::cin.good() << std::endl;
- std::cin.clear();
- std::cin.sync();
- std::cout << "podaj liczbe rzeczywista.";
- std::cin >> b;
- std::cout << "Czy udalo sie wczytac? " << std::cin.good() << std::endl;
- std::cin.clear();
- std::cin.sync();
- std::cout << "podaj dowolna liczbe rzeczywista.";
- std::cin >> c;
- std::cout << "Czy udalo sie wczytac? " << std::cin.good() << std::endl;
- std::cin.clear();
- std::cin.sync();
- std::cout << "Liczba a = " << a << std::endl;
- bool atak = std::cin.good();
- bool anie = std::cin.fail();
- std::cout << "Liczba b = " << b << std::endl;
- bool btak = std::cin.good();
- bool bnie = std::cin.fail();
- std::cout << "Liczba c = " << c << std::endl;
- bool ctak = std::cin.good();
- bool cnie = std::cin.fail();
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement