fork download
  1. #include <iostream>
  2. #include <string>
  3. #define f(i, s, e) for(int i = s; i < e; i++)
  4.  
  5. using namespace std;
  6.  
  7. string Hex(int n) {
  8. char a[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  9. char buff[3] = { a[n/16] , a[n%16] , 0 } ;
  10. return buff ;
  11. }
  12.  
  13. int main() {
  14. cout << Hex(33);
  15. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
21