Предмет: Информатика,
автор: dautov1
перераспределить значения переменных х и у так чтобы в х оказалось большее из этих значений а в у меньшее C#
Ответы
Автор ответа:
0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace pzn
{
class Program
{
public static void Main(string[] args)
{
int x = Convert.ToInt32(Console.ReadLine());
int y = Convert.ToInt32(Console.ReadLine());
int temp;
if (x<y)
{
x ^= y;
y ^= x;
x ^= y;
}
Console.WriteLine("x={0}, y={1}", x, y);
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace pzn
{
class Program
{
public static void Main(string[] args)
{
int x = Convert.ToInt32(Console.ReadLine());
int y = Convert.ToInt32(Console.ReadLine());
int temp;
if (x<y)
{
x ^= y;
y ^= x;
x ^= y;
}
Console.WriteLine("x={0}, y={1}", x, y);
Console.ReadKey();
}
}
}
Автор ответа:
0
спасибо
Похожие вопросы
Предмет: Информатика,
автор: comstesha
Предмет: Химия,
автор: shaatalovavika
Предмет: Информатика,
автор: artem3360
Предмет: Алгебра,
автор: 11Kek