Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char x;
  8. string y;
  9. cout << "Zadejte hexadecimalni cislo:" <<endl;
  10. cin.get(x);
  11. while (x!=10)
  12. {
  13. if ((x>47 && x< 58)||(x>96 && x< 103)||(x>64 && x< 71))
  14. {
  15. y += x;
  16. }
  17. else
  18. {
  19. cout<< "Nespravny vstup."<<endl;
  20. return 0;
  21. }
  22. cin.get(x);
  23. }
  24. cout << y;
  25. cout << sizeof(y-);
  26. cout<< "Desitkove: "<<x<<endl;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement