Look at using the switch statement instead of a bunch of if/else if statements.

Another possibility would be to use an array with 30 elements. Index it with the attack value entered by the user.
...