[DTOJ] 2704: Digital interchange, dtoj2704 Interchange

Source: Internet
Author: User

[DTOJ] 2704: Digital interchange, dtoj2704 Interchange

DTOJ 2704: Digital interchange solution report

  • 2017.11.11 First Edition--CoolOriginal

 

Question information:Description

Enter two numbers as the number of exchanges, and output the two values after the order of exchange.

Input

Two integers separated by Spaces

Output

Two integers after interchange, separated by Spaces

Sample Input

1 2

Sample output

2 1

Ideas:

My method is to reverse the positions of two numbers in the output. Another method is to assign the value of a to the temporary variable t, and then assign the value of B to a and t to B.

My code (C ++ ):
1 // DTOJ 2704 2 # include <iostream> 3 using namespace std; 4 5 int main () 6 {7 int a, B; 8 cin> a> B; 9 cout <B <"<a; 10 return 0; 11}

 


This work is licensed using the knowledge sharing signature-non-commercial use-share the 4.0 international license agreement in the same way.

-- Qoreng's Funny match w

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.