Module: サブルーチン: プロシージャと関数 - 2


Problem

5/10

最大 3 つの数字

Problem

2 つの数値の最大値を計算する関数を作成します。この関数を使用して、最大 3 つの数値を見つける関数を作成します。

入力: 3 行に 3 つの整数。
出力: プログラムは、受信した数値の最大値を表示する必要があります。

<本体>

入力 出力
1
2
3
3
1
using System;  
2
class Program  
3
{   
4
    static int FindMax(int x, int y)   
5
    {  
6
7
8
9
10
11
12
13
14
    }  
15
    static void Main()  
16
    {  
17
        int x = Convert.ToInt32(Console.ReadLine());  
18
        int y = Convert.ToInt32(Console.ReadLine());  
19
        int z = Convert.ToInt32(Console.ReadLine());  
20
21
        Console.WriteLine(ans);  
22
    }  
23
}  

     

Program check result

To check the solution of the problem, you need to register or log in!