즐거운프로그래밍

[자바] 노트패드++ if~else 문

수수께끼 고양이 2023. 10. 13. 14:23
728x90
반응형

 

public class ImportExam {
	public static void main(String args[]) {
			Random rand = new Random();
			int a = rand.nextInt(3);
			int b = rand.nextInt(3);
			
			if(a==b) { 
				System.out.println(a+ "와 "+b+"는 같다.");
			}
			else {
				System.out.println(a+ "와 "+b+"는 같지 않다.");
			}
	}
}

 

 

 

 

728x90
반응형