yunwon's tech blog

  • 홈
  • 용어
  • 깃헙
  • 방명록

Study/algorithm 12

[점프 투 자바] Multiples of 3 and 5

문제 프로젝트 오일러에 대해 들어본 적이 있는가? 프로젝트 오일러는 프로그래밍 퀴즈를 풀이하는 곳으로 전 세계적으로 유명하다. 이 곳에서 제공하는 퀴즈 중 가장 첫번째 인 "Multiples of 3 and 5" 를 함께 풀어보도록 하자. 문제는 다음과 같다. 10 미만의 자연수에서 3과 5의 배수를 구하면 3, 5, 6, 9이다. 이들의 총합은 23이다. 1000미만의 자연수에서 3, 5의 배수의 총합을 구하라. 풀이 public class multiplesof3and5{ int max; public multiplesof3and5(int max){ this.max = max; } public int sum(){ int sum = 0; for(int i = 0;i < max;i++){ if((i % 3 ..

Study/algorithm 2021.08.06

[점프 투 자바] 구구단

문제 예제를 보지 않고, 자신만의 구구단을 작성해보자 풀이 import java.util.*; public class multiplicationTable{ public static void main(String[] args){ Scanner sc = new Scanner(Sysete.in); int num; System.out.println("원하는 구구단은? "); num = sc.nextInt(); for(int i = 0;i < 9;i++){ System.out.print((num * (i+1)) + " "); } } } © 참고 https://wikidocs.net/236 위키독스 온라인 책을 제작 공유하는 플랫폼 서비스 wikidocs.net

Study/algorithm 2021.08.06
1 2
더보기

개발에

안드로이드 한스푼 🥄

  • 분류 전체보기
    • Android
      • study
      • kotlin
    • Project
      • review
      • boost course
      • rising programmer
      • softsphere
    • Study
      • algorithm
      • cs

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

Copyright © Kakao Corp. All rights reserved.

티스토리툴바