Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ExchangeIfGreater
- {
- class ExchangeIfGreater
- {
- static void Main()
- {
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- if (a > b)
- { // XOR algorithm
- a = a ^ b;
- b = a ^ b;
- a = a ^ b;
- Console.WriteLine(a + " " + b);
- }
- else
- {
- Console.WriteLine(a + " " + b);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement