The first blog post is a little bit better.
At the time, the first reaction to the problem was that it was just not hot. Java's binary conversion
But there seems to be no function with a non-decimal read-in or a string-to-numeric type
So a little tangled up and then accidentally "careful" to see the discuss and then hehe
This problem is obviously difficult for the teaching assistant in elementary school.
It's so quick to forget, "Okay, scar, forget the pain.
Body:
With some magical features of the C + + stream
CIN >>/* binary */>> * variable */;
Read in the set-up (that is, the input is read as the number of the binary).
cout <</* binary */<< * variable */;
Output (converts the value of the variable to the output of the input) with the set input
There are only three types of specific systems: Oct, DEC, Hex (eight or 10, hex respectively)
Attention:
After the input stream is set to the system, if the subsequent input does not specify a binary, the default is the previous set "instead of the default decimal
For output streams
On the Code
#include <cstdio>#include<iostream>usingnamespace std; int Main () { int A, b; while (Cin >> Hex >> a >> b) { << a + b << Endl; } return 0 ;}
hdu1720 C + + a water