Advertisement
mmayoub

Ex03, 01.05.2021

May 1st, 2021
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1.  
  2. // 01.05.2021
  3. import java.util.Scanner;
  4.  
  5. public class Ex03 {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner in = new Scanner(System.in);
  9.  
  10.         int a, b, c;
  11.  
  12.         // input data from user
  13.         System.out.print("Enter a: ");
  14.         a = in.nextInt();
  15.         System.out.print("Enter b: ");
  16.         b = in.nextInt();
  17.  
  18.         // part a
  19.         c = 180 - a - b;
  20.         System.out.println("c= " + c);
  21.  
  22.         // part b
  23.         if ((a == 60) && (b == 60) && (c == 60)) {
  24.             System.out.println("Motaswee aladla3");
  25.         }
  26.  
  27.         if ((a == b) || (a == c) || (b == c)) {
  28.             System.out.println("Motasawe al-sakain");
  29.         }
  30.  
  31.         // part c
  32.         if ((a == 90) || b == 90 || c == 90) {
  33.             System.out.println("Kaem alzaweia");
  34.         }
  35.     }
  36.  
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement