Why are you using one input and the % operator? What happens if your triangle has sides 10, 11 and 12? Why not use three inputs to the three sides?
If you are having problems with Exceptions with Scanner try entering all three numbers in one line
10 11 12
instead of
10
11
12
. . . and ask again because there is a pitfall with Scanner which you may not be aware of.