본문 바로가기
728x90

Java 개발자 수업 강의노트/Java 일일 과제18

순차 역순 증가가 함께 있는 2차 배열 (2) #if문을 사용하지 않고 순차와 역순 증가를 출력. 결과) 1 2 3 4 8 7 6 5 9 10 11 12 public class AprilTwentysix2 { public static void main(String[] args) { // int[][] arr = new int[3][4]; int num=1; int j=0; int sign=1; for(int i=0; i 2012. 5. 1.
간단 전화번호부 #간단하게 기본적으로 배운 배열과 제어문을 이용해 만든 일회성 전화번호부... DB와의 연동을 안했기에 당연히 종료를 하면 안에 있는 데이터는 전부 지워진다... package project; import java.util.Scanner; public class Telephone { public static void main(String[] args) { // 간단 전화번호부 //배열 및 변수 초기화 String[] names = new String[30]; int[] phones = new int[30]; int Position = 0; Scanner sc = new Scanner(System.in); Scanner nc = new Scanner(System.in); Scanner pc = new Sc.. 2012. 4. 30.
순차 역순 증가가 함께 있는 2차 배열 # 0행에서는 값이 순차 증가, 1행에서는 역순으로 증가하는 2차 배열결과)1 2 3 4 510 9 8 7 611 12 13 14 15 public static void main(String[] args) {// int[][] arr = new int[3][4];int num=1;for(int i=0; i 2012. 4. 26.
열증가 #열이 증가하는 형식의 2차 배열을 완성 결과)1 4 7 102 5 8 113 6 9 12 public static void main(String[] args) {// 열증가int[][] arr = new int[3][4];int num=1;for(int i=0; i 2012. 4. 26.
구구단 가로 출력 #구구단을 가로로 출력하는 프로그램 결과) 와 같이 출력이 되게 해야한다. public static void main(String[] args) { //구구단 가로 출력 for(int i=1; i 2012. 4. 25.
구구단 세로 출력 #구구단을 세로로 출력하는 프로그램 결과) 2x1= 2 2x2= 4 2x3= 6 2x4= 8 〃〃〃 9x5= 45 9x6= 54 9x7= 63 9x8= 72 9x9= 81 public static void main(String[] args) { //구구단 세로 출력 for(int i=2; i 2012. 4. 25.
SMALL