대건 숙제

강kang·2024년 12월 11일

using System;

int input1 = Convert.ToInt32(Console.ReadLine());
int input2 = Convert.ToInt32(Console.ReadLine());
int input3 = Convert.ToInt32(Console.ReadLine());
int first = 0;
int second = 0;
int third = 0;

if (input1 >= input2 && input1 >= input3)
{
first = input1;

if (input2 >= input3)
{
    second = input2;
    third = input3;
}
else 
{
    second = input3;
    third = input2;
}

}

else if (input2 >= input1 && input2 >= input3)
{
first = input2;

if (input1 >= input3)
{
    second = input1;
    third = input3;
}
else
{
    second = input3;
    third = input1;
}

}

else if (input3 >= input1 && input3 >= input2)
{
first = input3;

if (input1 >= input2)
{
    second = input1;
    third = input2;
}
else if(input2 >= input1)
{
    second = input2;
    third = input1;
}

}

Console.WriteLine(third + " " + second + " " + first);

profile
코딩

0개의 댓글