Very interesting task, my friend! Here is what I have as a solution:
import java.util.Scanner;
public class Pr_09_HitTheTarget {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int result = scanner.nextInt();
for (int i = 1; i <= 20; i++) {
for (int j = 1; j <= 20; j++) {
if (i + j == result) {
System.out.println(i + "+" + j + "=" + result);
}
}
}
for (int i = 1; i <= 20; i++) {
for (int j = 1; j <= 20; j++) {
if (i - j == result) {
System.out.println(i + "-" + j + "=" + result);
}
}
}
}
}