Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <locale.h>
- #include <iostream> // здесь "живёт" setlocale(LC_ALL, "rus");
- using namespace std;
- char* hex_16(const char *psz);
- char a[256];
- int n = 0;
- ////////////////////////////////////////////////////////
- int main()
- {
- cin >> a;
- printf("%s", hex_16(a) );
- return 0;
- }
- //////////////////////////////////////////////////////// const
- char* hex_16(const char *psz)
- {
- int i = 0;
- static char sz[256];
- char sz1[3];
- while(psz[i] != 0)
- {
- sprintf(sz1, "%X", psz[i]);
- strcat(sz, sz1);
- i++;
- }
- return sz;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement