inceput
intreg n, max, c1, c2, c3, c4
citeste n
c4 <- n mod 10
n <- n div 10
c3 <- n mod 10
n <- n div 10
c2 <- n mod 10
n <- n div 10
c1 <- n
max <- c1
daca c2 > max atunci
max <- c2
sfarsit daca
daca c3 > max atunci
max <- c3
sfarsit daca
daca c4 > max atunci
max <- c4
sfarsit daca
scrie max
sfarsit