Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char x;
- string y;
- cout << "Zadejte hexadecimalni cislo:" <<endl;
- cin.get(x);
- while (x!=10)
- {
- if ((x>47 && x< 58)||(x>96 && x< 103)||(x>64 && x< 71))
- {
- y += x;
- }
- else
- {
- cout<< "Nespravny vstup."<<endl;
- return 0;
- }
- cin.get(x);
- }
- cout << y;
- cout << sizeof(y-);
- cout<< "Desitkove: "<<x<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement