Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SumTo13 {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int a = scan.nextInt();
- int b = scan.nextInt();
- int c = scan.nextInt();
- String result = "";
- if (a + b + c == 13
- || a + b - c == 13
- || a - b + c == 13
- || a - b - c == 13
- || -a + b + c == 13
- || -a - b + c == 13
- || -a -b - c == 13
- || - a + b - c == 13){
- result = "Yes";
- }
- else{
- result = "No";
- }
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment