import sys
from pip._vendor.distlib.compat import raw_input
Zero = [" *** ",
" * * ",
"* *",
"* *",
"* *",
" * * ",
" *** "]
One = [" * ", "** ", " * ", " * ", " * ", " * ", "***"]
Two = [" *** ", "* *", "* * ", " * ", " * ", "* ", "*****"]
Three = [" *** ", "* *", " *", " ** ", " *", "* *", " *** "]
Four = [" * ", " ** ", " * * ", "* * ", "******", " * ",
" * "]
Five = ["*****", "* ", "* ", " *** ", " *", "* *", " *** "]
Six = [" *** ", "* ", "* ", "**** ", "* *", "* *", " *** "]
Seven = ["*****", " *", " * ", " * ", " * ", "* ", "* "]
Eight = [" *** ", "* *", "* *", " *** ", "* *", "* *", " *** "]
Nine = [" ****", "* *", "* *", " ****", " *", " *", " *"]
Digits = [Zero, One, Two, Three, Four, Five, Six, Seven, Eight, Nine]
try:
digits = raw_input("Введите число\n") # Заменяем передачу аргумента при запуске на введение пользователем
row = 0
while row < 7:
line = ""
column = 0
while column < len(digits):
number = int(digits[column])
digit = Digits[number]
line += digit[row] + " "
column += 1
print(line)
row += 1
except IndexError:
print("usage: bigdigits.py <number>")
except ValueError as err:
print(err, "in", digits)
public class Main
{
const int ARRAY_SIZE = 5;
public static void main(String[] args) throws IOException{
int[] working_array = create_array_and_fill_it_from_stdin();
find_max_and_min_in_array_and_print_them(working_array);
}
public static int[] create_array_and_fill_it_from_stdin(){
int[] array = new int[ARRAY_SIZE];
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0; i < array.length; i++){
String s = reader.readLine();
int value = Integer.parseInt(s);
array[i] = value;
}
return array;
}
public static void find_max_and_min_in_array_and_print_them(int[] array){
int max = array[0];
int min = array[0];
for (int i = 0; i < array.length; i++){
if (max < array[i])
max = array[i];
if (min > array[i])
min = array[i];
}
System.out.println("Minumum is: "+min);
System.out.println("Maximum is: "+max);
}
}