fojtasd

Untitled

Oct 25th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. string input;
  8. cout << "Zadej cislo ve dvojkove soustave:" << endl;
  9. cin >> input;
  10.  
  11. //kontrola vstupu
  12. for (int i=0; i < input.size(); i++)
  13. {
  14. char ch = input[i];
  15. if ((ch !='0') && (ch!='1') && (ch !=c))
  16. {
  17. cout << "Nespravny vstup." << endl;
  18. return 0;
  19. }
  20.  
  21. }
  22.  
  23. cout << "b" << endl;
  24. //vystup je zkontrolován
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment