Hangzhou Electric HDU ACM 1720 a+b Coming

Source: Internet
Author: User

A+b Coming Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 6464 Accepted Submission (s): 4248


Problem Descriptionmany classmates said to me, a+b is must needs.
If you can ' t AC this problem, you would invite me for night meal. ^_^

Inputinput may contain multiple test cases. Each case contains A and B on one line.
A, B is hexadecimal number.
Input terminates by EOF.

Outputoutput a+b in decimal number on one line.
Sample Input
1 9A Ba b

Sample Output
102121
There is no word in this question ... I've seen it before, but forget it!! Knowledge One: Converting 16 into a 10-in exception: AB converts to Dec;0xab
= 0x0A * + 0x0B
= 10 * 16 + 11
= 171
C input hexadecimal and octal methods: scanf ("%x%x", &a,&b); scanf ("%o%o", &a,&b);
The C + + method:cin>>hex>>a>>b;cin>>oct>>a>>b; output is similar to the
If you lose, you have to eat! AC:
#include <iostream>using namespace Std;int main () {int a,b;while (cin>>hex>>a>>b)  cout <<dec<<a+b<<endl;return 0;}

Hangzhou Electric HDU ACM 1720 a+b Coming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.