Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4.  
  5.  
  6. #include <iostream>
  7. using namespace std;
  8. char int_symbol(int in) {
  9. char out[] = { '0','1','2','3','4','5','6','7','8','9',
  10. 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
  11. 'Q','R','S','T','U','V','W','X','Y','Z' };
  12. return out[in];
  13. }
  14.  
  15.  
  16. void ten_base(int in, int base) {
  17.  
  18. if (in < base) {
  19. std::cout<< int_symbol(in);
  20.  
  21. return;
  22. }
  23. ten_base(in / base, base);
  24. std::cout << int_symbol(in % base);
  25.  
  26. }
  27.  
  28.  
  29. int main() {
  30. for (int j = 1; j < 14; j++) {
  31. cout << setw(5) << j << "|";
  32. }
  33. printf("\n");
  34. int in;
  35. int base = 14;
  36. for (int i = 1; i < 14; i++) {
  37. cout << setw(2) << i << setw(1)<<"|";
  38. for (int j = 1; j < 14; j++) {
  39. in = i * j;
  40. cout << setw(2);
  41. ten_base(in, base);
  42.  
  43.  
  44. }
  45. printf("\n");
  46. }
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement