main.cpp 376 B

123456789101112131415161718
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main() {
  5. string stringA, stringB;
  6. while (cin >> stringA >> stringB){
  7. char *charA, *charB;
  8. charA = (char *) stringA.data();
  9. charB = (char *) stringB.data();
  10. int a, b;
  11. sscanf(charA, "%x", &a);
  12. sscanf(charB, "%x", &b);
  13. cout << a + b << endl;
  14. }
  15. }