큐범
Just do debug
큐범
전체 방문자
오늘
어제
  • 전체보기 (132)
    • 회고 (4)
    • JAVA (16)
      • JAVA 기초 (18)
      • JAVA Algorithm, Datastruct (13)
    • Spring (11)
    • Micro Service Architecture (3)
    • JPA (6)
    • gRPC (4)
    • Network (8)
    • Process (7)
    • Cloud (4)
    • Python (10)
    • Web(vue) (2)
    • UMC (1)
    • DB (9)
    • CS (5)
    • Clean Code (1)
    • TDD (9)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

인기 글

최근 댓글

최근 글

hELLO · Designed By 정상우.
큐범

Just do debug

JAVA/JAVA Algorithm, Datastruct

[Algorithm] JAVA 코드업 기초 100제 (기초-반복실행구조) 1071 ~ 1077

2022. 9. 4. 03:12

1071 : [기초-반복실행구조] 0 입력될 때까지 무한 출력하기1(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		
		String[] array = s.split(" ");
		
		for(String x : array) {
			if(!x.equals("0")) {
				System.out.println(x);
			}else {
				break;
			}
		}
	}

1072 : [기초-반복실행구조] 정수 입력받아 계속 출력하기(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int key = sc.nextInt(); 
		int[] array = new int[key];
		
		for(int i=0; i<array.length; i++) {
			array[i] = sc.nextInt();
		}
		
		for(int x : array) {
			System.out.println(x);
		}
		
	}

1073 : [기초-반복실행구조] 0 입력될 때까지 무한 출력하기2(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true) {
			int i = sc.nextInt();
			
			if(i==0) break;
			System.out.println(i);
		}
	}

1074 : [기초-반복실행구조] 정수 1개 입력받아 카운트다운 출력하기1(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int i = sc.nextInt();

		while(i!=0) {
			System.out.println(i);
			i--;
		}
	}

1075 : [기초-반복실행구조] 정수 1개 입력받아 카운트다운 출력하기2(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int i = sc.nextInt();

		while(i!=0) {
			i--;
			System.out.println(i);
		}
	}

1076 : [기초-반복실행구조] 문자 1개 입력받아 알파벳 출력하기(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char c = sc.next().charAt(0);

		for(int i=97; i<=c; i++) {
			System.out.print(Character.toString(i)+" ");
		}
	}

1077 : [기초-반복실행구조] 정수 1개 입력받아 그 수까지 출력하기(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int c = sc.nextInt();

		for(int i=0; i<=c; i++) {
			System.out.println(i);
		}
	}
    'JAVA/JAVA Algorithm, Datastruct' 카테고리의 다른 글
    • [Algorithm] JAVA 코드업 기초 100제 (기초-1차원배열, 2차원배열) 1093 ~ 1099
    • [Algorithm] JAVA 코드업 기초 100제 (기초-종합) 1078 ~ 1092
    • [Algorithm] JAVA 코드업 기초 100제 (기초-삼항연산, 선택실행 구조) 1063 ~ 1070
    • [Algorithm] JAVA 코드업 기초 100제 (기초-비트단위논리연산) 1059 ~ 1062
    큐범
    큐범

    티스토리툴바