Customizing output in accordance to the input I wanted to know if I overdid it and maybe could have kept this code simpler and cleaner. I need to execute this assignment:

Write a program called multi_input.cpp that prompts the user to enter
several integers in any combination of octal, decimal, or hexadecimal,
using the 0 and 0x base suffixes; interprets the numbers correctly,
and converts them to decimal form. Then your program should output the
values in properly spaced columns like this:
      0x4 hexadecimal converts to     67 decimal
     0123 octal       converts to     83 decimal
       65 decimal     converts to     65 decimal


Now the code compiles and does what it's intended to do, but I still need to get into that programmer state of mind where you keep only the stuff that really matters, to the last letter (thus keeping the code simple, succinct and efficient). Showing me what I can get rid of and revise would bring me closer to achieving this.
#include&quot;..\..\Header.h&quot;

void print_number(const string&amp; concatenation, const string&amp; type) {
    istringstream s(concatenation);
    int number = 0;
    if(type == &quot;hexadecimal&quot;) s &gt;&gt; hex &gt;&gt; number;
    if (type == &quot;octal&quot;) s &gt;&gt; oct &gt;&gt; number;
    else s &gt;&gt; number;
    cout &lt;&lt; concatenation &lt;&lt; '\t' &lt;&lt; type &lt;&lt; &quot;\tconverts to &quot; &lt;&lt; dec &lt;&lt; number &lt;&lt; &quot; decimal.\n&quot;;
}

int main() {
    while (cin) {
        string da;
        cin &gt;&gt; da;
        if (da[0] == '0') {
            if (da[1] == 'x') print_number(da, &quot;hexadecimal&quot;);
            else print_number(da, &quot;octal&quot;);
        }
        else print_number(da, &quot;decimal&quot;);
    }
    system(&quot;pause&quot;);
    return 0;
}

Header contains these lines (just in case):
    #include &lt;algorithm&gt;
#include &lt;cmath&gt;
#include &lt;vector&gt;
#include &lt;iostream&gt;
#include &lt;sstream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;

using namespace std;

void error(const string&amp; a) {
    throw runtime_error(a);
}
Let's start off with a few general hints and tips:


First of all, as πάντα ῥεῖ already stated in the comments, using using namespace std is not a good idea, and doing that in a header if a lot worse. You're begging to introduce subtle bugs into your code as time goes on and things are added to your project and the standard libraries. Typing std:: a few times is not going to kill you, I'm sure.
#include"..\..\Header.h" is a code smell; relative paths in an include often indicate that your project structure is not good or your compile flags are not complete. You should specify all necessary include directories in the compiler invocation command line.
system("pause"); is not portable and should thus not be used unless absolutely necessary. Is this the case here? I don't think so. Make users of other operating systems (i.e. operating systems that aren't Microsoft Windows) happy and remove that line.
What happens if I enter the string "0" to your program? Whoops, undefined behavior! Why? if (da[1] == 'x') requires da to be at least two characters long, which in my case it simply doesn't happen to be. You should add a check to verify that this condition is satisfied.
Header.h seems redundant and superfluous. All of those includes should be at the top of your implementation file, not in the header. All includes that are not used (e.g. fstream) should be removed. The function error doesn't serve any real purpose, except obscuring the fact that something throws and exception, which can lead to people wondering where those exceptions come from. Also it isn't used, so it should be removed as well.




Now, let's talk about print_number in particular. One issue I have with this function is that type should never, ever be a string. You're wasting performance and causing binary bloat, when the fix would be to simply add an enum class with three members HEX, OCT and DEC. The other big issue is that this function limits its own usability by necessarily writing to std::cout. This has the potential to cause people using that function and wanting to separate outputs much grief, and is easily circumvented by having the function take a std::ostream&amp; as parameter and writing to it instead. When invoking the function, you then simply pass std::cout as an argument. 

Finally, this function does a little bit too much; two completely separate tasks, to be precise. One is taking a number in a given format and converting it to decimal, and the other is actually printing that number in a nicely formatted way. You should thus split it up into two functions: One which does the extraction, and one which does the output.