OJ "decimal, octal and hexadecimal number 1000 corresponding to decimal number output"

Source: Internet
Author: User

Title Description

The 1234 output of the decimal

Outputs the octal 1234 corresponding to its decimal number

Outputs the hexadecimal 1234 corresponding to its decimal number

Input

No

Output

1234d=1234d

1234o=668d

1234h=4660d

Sample output
1234d=1234d1234o=668d1234h=4660d
Tips

Output the second line of "1234o=668d", 1234 is the capital letter O, not the number 0


The code is as follows:

#include <iostream> #include <iomanip>using namespace Std;int main () {    int x1=1234;    int x2=01234;    int x3=0x1234;    cout<<x1<< "d=" <<dec<<x1<< "D" <<endl;    cout<<oct<<x2<< "o=" <<dec<<x2<< "D" <<endl;    cout<

Operation Result:




OJ "decimal, octal and hexadecimal number 1000 corresponding to decimal number output"

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.