hdu1720 C + + a water

Source: Internet
Author: User

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

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.