Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.InputEncoding = Encoding.Unicode;
- Console.OutputEncoding = Encoding.Unicode;
- bool loopExitFlag = false;
- while ( !loopExitFlag )
- {
- Console.Write( "a = " );
- string aRaw = Console.ReadLine();
- int a = int.Parse( aRaw );
- Console.Write( "b = " );
- string bRaw = Console.ReadLine();
- int b = int.Parse( bRaw );
- Console.WriteLine( $"a = {a}, b = {b}" );
- Console.WriteLine( $"SWAP" );
- (a, b) = (b, a);
- Console.WriteLine( $"a = {a}, b = {b}\n" );
- Console.WriteLine( "Continue? Enter 'n' for exit" );
- string continueAnswer = Console.ReadLine();
- string exitAnswer = "n";
- loopExitFlag = string.Equals( continueAnswer, exitAnswer );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement