• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# 1

a guest Feb 25th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import java.io.*;
2.
3. public class Main {
4.     public static void main(String[] args) throws Exception {
6.
10.
11.     int a = Integer.parseInt(a1);
12.     int b = Integer.parseInt(b1);
13.     int c = Integer.parseInt(c1);
14.
15.     int x = Math.min(a, Math.min(b,c)); //Π½Π°ΡΠΎΠ΄ΠΈΠΌ ΠΌΠΈΠ½ΠΈΠΌΡΠΌ
16.     int y = Math.max(a, Math.max(b,c)); //Π½Π°ΡΠΎΠ΄ΠΈΠΌ ΠΌΠ°ΠΊΡΠΈΠΌΡΠΌ
17.
18.     int sum = a + b + c; //Π½Π°ΡΠΎΠ΄ΠΈΠΌ ΡΡΠΌΠΌΡ ΡΠΈΡΠ΅Π»
19.     int average = sum - (x + y); //Π½Π°ΡΠΎΠ΄ΠΈΠΌ ΡΡΠ΅Π΄Π½Π΅Π΅, Π²ΡΡΠΈΡΠ°Ρ ΠΈΠ· ΡΡΠΌΠΌΡ ΠΌΠ°ΠΊΡ ΠΈ ΠΌΠΈΠ½
20.
21.     if (a == b && b == c) { //Π΅ΡΠ»ΠΈ 3 ΡΠΈΡΠ»Π° ΡΠ°Π²Π½Ρ, Π²ΡΠ²ΠΎΠ΄ΠΈΠΌ Π»ΡΠ±ΠΎΠ΅ ΠΈΠ· Π½ΠΈΡ
22.         System.out.println(a);
23.     }
24.     else if (a == b && b != c) { //Π΅ΡΠ»ΠΈ 2 ΡΠΈΡΠ»Π° ΡΠ°Π²Π½Ρ, Π²ΡΠ²ΠΎΠ΄ΠΈΠΌ Π»ΡΠ±ΠΎΠ΅ ΠΈΠ· Π½ΠΈΡ
25.         System.out.println(a);
26.     }
27.     else if (b == c && c != a) { //Π΅ΡΠ»ΠΈ 2 ΡΠΈΡΠ»Π° ΡΠ°Π²Π½Ρ, Π²ΡΠ²ΠΎΠ΄ΠΈΠΌ Π»ΡΠ±ΠΎΠ΅ ΠΈΠ· Π½ΠΈΡ
28.         System.out.println(b);
29.     }
30.     else if (c == a && a != b) { //Π΅ΡΠ»ΠΈ 2 ΡΠΈΡΠ»Π° ΡΠ°Π²Π½Ρ, Π²ΡΠ²ΠΎΠ΄ΠΈΠΌ Π»ΡΠ±ΠΎΠ΅ ΠΈΠ· Π½ΠΈΡ
31.         System.out.println(c);
32.     }
33.     else System.out.println(average); //Π² ΠΏΡΠΎΡΠΈΠ²Π½ΠΎΠΌ ΡΠ»ΡΡΠ°Π΅ Π²ΡΠ²ΠΎΠ΄ΠΈΠΌ ΡΡΠ΅Π΄Π½Π΅Π΅
34.     }
35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top