큐범
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제 (기초-종합) 1078 ~ 1092

2022. 9. 5. 02:10

1078 : [기초-종합] 짝수 합 구하기(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		
		int sum=0;
		for(int i=0; i<=s; i++) {
			if(i%2==0) {
				sum +=i;
			}
		}
		System.out.println(sum);
	}

1079 : [기초-종합] 원하는 문자가 입력될 때까지 반복 출력하기

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

1080 : [기초-종합] 언제까지 더해야 할까?

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int key = sc.nextInt();
		int sum=0;
		
		for (int i=0; i<=key; i++) {
			sum+=i;
			if(sum>=key) {
				System.out.println(i);
				break;
			}
		}
	}

1081 : [기초-종합] 주사위를 2개 던지면?(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		
		int[] array = Arrays.stream(s.split(" "))
				.mapToInt(Integer::parseInt)
				.toArray();
		
		for(int i=1; i<=array[0]; i++) {
			for(int j=1; j<=array[1]; j++) {
				System.out.println(i+" "+j);
			}
		}
	}

1082 : [기초-종합] 16진수 구구단?

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int c = sc.nextInt(16);
		
		for(int i=1; i<=16; i++) {
			System.out.printf("%X*%X=%X\\n",c,i,c*i);
		}
	}

1083 : [기초-종합] 3 6 9 게임의 왕이 되자!(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int key = sc.nextInt();
		
		for(int i=1; i<=key; i++) {
			if(i%3==0) {
				System.out.print("X ");
			}else {
				System.out.print(i+" ");
			}
		}
	}

1084 : [기초-종합] 빛 섞어 색 만들기(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		
		int[] array = Arrays.stream(s.split(" "))
				.mapToInt(Integer::parseInt)
				.toArray();
		
		int count=0;
		
		for(int i=0; i<array[0]; i++) {
			for(int j=0; j<array[1]; j++) {
				for(int k=0; k<array[2]; k++) {
					System.out.println(i+" "+j+" "+k+" ");
					count++;
				}
			}
		}
		System.out.println(count);
	}

1085 : [기초-종합] 소리 파일 저장용량 계산하기(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String key = sc.nextLine();
		
		String[] array = key.split(" ");
		
		double h = Double.valueOf(array[0]);
		double b = Double.valueOf(array[1]);
		double c = Double.valueOf(array[2]);
		double s = Double.valueOf(array[3]);
		
		System.out.printf("%.1f MB",(h*b*c*s)/8/1024/1024);
	}

1086 : [기초-종합] 그림 파일 저장용량 계산하기(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String key = sc.nextLine();
		
		String[] array = key.split(" ");
		
		double w = Double.valueOf(array[0]);
		double h = Double.valueOf(array[1]);
		double b = Double.valueOf(array[2]);
		
		System.out.printf("%.2f MB",(w*h*b)/8/1024/1024);
	}

1087 : [기초-종합] 여기까지! 이제 그만~(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int key = sc.nextInt();
		
		int sum=0;
		for(int i=0; i<=key; i++) {
			sum+=i;
			if(sum>=key) {
				System.out.println(sum);
				break;
			}
		}
	}

1088 : [기초-종합] 3의 배수는 통과?(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int key = sc.nextInt();
		
		for(int i=0; i<=key; i++) {
			if(i%3!=0) {
				System.out.print(i+" ");
			}
		}
	}

1089 : [기초-종합] 수 나열하기1

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		
		int a = Integer.parseInt(s.split(" ")[0]);
		int d = Integer.parseInt(s.split(" ")[1]);
		int n = Integer.parseInt(s.split(" ")[2]);
		
		for(int i=a; i<n; i++) {
			a+=d;
		}
		System.out.println(a);
	}

1090 : [기초-종합] 수 나열하기2

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		
		int a,r,n;
		a=Integer.parseInt(s.split(" ")[0]);
		r=Integer.parseInt(s.split(" ")[1]);
		n=Integer.parseInt(s.split(" ")[2]);
		
		for(int i=a; i<=n; i++) {
			a*=r;
		}
		System.out.println(a);
	}

1091 : [기초-종합] 수 나열하기3

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		
		int a,m,d,n;
		a=Integer.parseInt(s.split(" ")[0]);
		m=Integer.parseInt(s.split(" ")[1]);
		d=Integer.parseInt(s.split(" ")[2]);
		n=Integer.parseInt(s.split(" ")[3]);
		
		for(int i=a; i<n; i++) {
			a=a*m+d;
		}
		System.out.println(a);
	}

1092 : [기초-종합] 함께 문제 푸는 날(설명)

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		
		int a,b,c,day;
		a=Integer.parseInt(s.split(" ")[0]);
		b=Integer.parseInt(s.split(" ")[1]);
		c=Integer.parseInt(s.split(" ")[2]);
		
		day=1;
		
		while(day%a!=0 || day%b!=0 || day%c!=0) day++;
		System.out.println(day);
	}
    'JAVA/JAVA Algorithm, Datastruct' 카테고리의 다른 글
    • [JAVA] Arrays.sort() Collection.sort() 정렬 알고리즘
    • [Algorithm] JAVA 코드업 기초 100제 (기초-1차원배열, 2차원배열) 1093 ~ 1099
    • [Algorithm] JAVA 코드업 기초 100제 (기초-반복실행구조) 1071 ~ 1077
    • [Algorithm] JAVA 코드업 기초 100제 (기초-삼항연산, 선택실행 구조) 1063 ~ 1070
    큐범
    큐범

    티스토리툴바