Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- string input;
- cout << "Zadej cislo ve dvojkove soustave:" << endl;
- cin >> input;
- //kontrola vstupu
- for (int i=0; i < input.size(); i++)
- {
- char ch = input[i];
- if ((ch !='0') && (ch!='1') && (ch !=c))
- {
- cout << "Nespravny vstup." << endl;
- return 0;
- }
- }
- cout << "b" << endl;
- //vystup je zkontrolován
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment