ralitsa_d

SumTo13

Jan 9th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SumTo13 {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6.  
  7. int a = scan.nextInt();
  8. int b = scan.nextInt();
  9. int c = scan.nextInt();
  10.  
  11. String result = "";
  12.  
  13. if (a + b + c == 13
  14. || a + b - c == 13
  15. || a - b + c == 13
  16. || a - b - c == 13
  17. || -a + b + c == 13
  18. || -a - b + c == 13
  19. || -a -b - c == 13
  20. || - a + b - c == 13){
  21. result = "Yes";
  22. }
  23. else{
  24. result = "No";
  25. }
  26.  
  27. System.out.println(result);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment