[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