본문 바로가기

Kim Hyeong

검색하기
Kim Hyeong
프로필사진 김형완

  • 분류 전체보기 (50)
    • java 공부 (15)
    • 코딩 공부 (3)
    • Spring (12)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록코딩 공부 (3)

Kim Hyeong

완전수 구하기

import javax.swing.JOptionPane; public class Exam10_3 {public static void main(String[] args) { int num, i, sum;num = Integer.parseInt(JOptionPane.showInputDialog("값입력 하세요~"));System.out.print(num + "의 약수는 : " + 1 + ", ");sum = 1;for (i = 2; i

코딩 공부 2018. 8. 10. 11:26
최대공약수 최소공배수 구하기

import javax.swing.JOptionPane;public class Exam10_3 {public static int gcd(int a, int b){//최소공약수while(a != b){if(a>b) {a=a-b;}else if(b>a) {b=b-a;}}//whilereturn a;}public static int lcm(int a, int b){//최대 공배수return((a*b)/gcd(a,b));} public static void main(String[] args) {int num1, num2,imsi1, imsi2;num1=Integer.parseInt(JOptionPane.showInputDialog("값입력 하세요~"));num2=Integer.parseInt(JOptionPan..

코딩 공부 2018. 8. 10. 11:22
Prev 1 2 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바