📜  Java程序找出哪个部门的安置程序最高 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:25.498000             🧑  作者: Mango

代码示例1
import java.util.Scanner;public class Main{public static void main (String[] args){Scanner sc=new Scanner(System.in);System.out.println("Enter no of students placed in Computer science");int Computerscience= sc.nextInt();System.out.println("Enter no of students placed in Electronics");int Electronics=sc.nextInt();System.out.println("Enter no of students placed in Mechanical");int Mechanical=sc.nextInt();if(Computerscience<0||Electronics<0||Mechanical<0){System.out.println("Enter the number properly");}else if(Computerscience==Electronics && Electronics==Mechanical){System.out.println("None of the department has got the highest placement");}else if(Computerscience==Electronics && MechanicalElectronics&&Computerscience>Mechanical){System.out.println("Highest placement");System.out.println("Computer science");}else if(Electronics>Computerscience && Electronics>Mechanical){System.out.println("Highest placement");System.out.println("Electronics");}else if(Mechanical>Computerscience && Mechanical>Electronics){System.out.println("Highest placement");System.out.println("Mechanical");}}}