Maris 코딩
  • 게시글 대표 이미지 썸네일 주소
    [ 문풀/코드업 ]
    [코드업] 1080_[기초-종합] 언제까지 더해야 할까?
    2024-07-20 18:23:17
    import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int sum = 0; // 합계를 저장할 변수 int i = 0; // 현재 숫자를 저장할 변수 while (sum   -- 결과 --
  • 게시글 대표 이미지 썸네일 주소
    [ 문풀/코드업 ]
    [코드업] 1079_원하는 문자가 입력될 때까지 반복 출력하기
    2024-07-20 18:13:00
    import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(true) { String S = sc.next(); System.out.println(S); if(S.equals("q")) { break; } } }}       while 밖에서 입력받는 경우 import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in);..
  • 게시글 대표 이미지 썸네일 주소
    [ 문풀/코드업 ]
    [코드업] 1152_10보다 작은 수 (else 버전)
    2024-07-19 00:06:46
    import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); if(num     public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("숫자를 입력하세요 : "); int num = sc.nextInt(); if(num   -- 결과 --
  • 게시글 대표 이미지 썸네일 주소
    [ 문풀/코드업 ]
    [코드업] 1151_10보다 작은 수
    2024-07-18 23:59:02
    import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); if (num      public static void main(String[] args) { // 10보다 작은 수가 입력되면 small 을 출력, 10이상이면 아무것도 출력하지 마시오. Scanner sc = new Scanner(System.in); System.out.print("숫자를 입력하세요 : "); int num = sc.nextInt(); if (num   -- 결과 --