ふらっとC#,C♯,C#(初心者用) Part26at TECH
ふらっとC#,C♯,C#(初心者用) Part26 - 暇つぶし2ch119:デフォルトの名無しさん
08/03/25 18:38:12
入力された数字を大きい順番に並べるプログラムですがbを一番大きくなるよう入力すると重複してますといわれます。どなたか理由をおしえてください
public static void Main()
{
START:
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int c = int.Parse(Console.ReadLine());
if (a > b)
{if (a > c){if (c > b){Console.Write("{0}{1}{2}", a, c, b);
}else{
Console.Write("{0}{1}{2}", a, b, c);
}
}else{
Console.Write("{0}{1}{2}", c, a, b);
}
}else{
if (b > c)
{
if (a > c)
{
Console.Write("{0}{1}{2}", b, a, c);
}else{
Console.Write("{0}{1}{2}", b, c, a);
}
}
if (c > a && c > b)
{
Console.Write("{0}{1}{2}", c, b, a);
}else{
Console.Write("数字が重複していますカエレ");


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch