Contents

Views 10349 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

# 최대 공약수 구하는 함수

#include<stdio.h>
#include<conio.h>

int gcd(int m, int n) {
    if (m<=0) return 0;
    if (n<=0) return 0;
    while(m != n){
        if (m>n) m = m - n;
        else n = n - m;
    }
    return n;
}

void main(){
    int a,b;

    printf("Enter a first Number : ");
    scanf("%d",&a);

    printf("Enter a second Number : ");
    scanf("%d",&b);

    printf("GCD is %d",gcd(a,b));
    getch();
} 


?

  1. 최근 논문 자료 (2011/01/03, 만현형한테 보낸거..)

    Date2013.04.23 CategoryDevelop Byhooni Views10366
    Read More
  2. [c] 최대공약수 알고리즘 (유클릿)

    Date2003.04.23 CategoryDevelop Byhooni Views10349
    Read More
  3. [java] 스윙(swing)버튼 테스트 ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views10310
    Read More
  4. [c] 다중연결 서버 만들기 #2 - select() 사용

    Date2013.04.23 CategoryDevelop Byhooni Views10287
    Read More
  5. [c] 약수/최대공약수/완전수 알고리즘

    Date2003.04.23 CategoryDevelop Byhooni Views10271
    Read More
  6. [js] jQuery 셀랙터(selector) 요약

    Date2013.12.17 CategoryDevelop Byhooni Views10266
    Read More
  7. [c++] mfc이용한 트레이아이콘(TrayIcon) 클래스 예제 프로젝트

    Date2013.04.23 CategoryDevelop Byhooni Views10254
    Read More
  8. 다운 받아서 테스트 해볼것..

    Date2013.04.23 CategoryDevelop Byhooni Views10237
    Read More
  9. [java] RGB 색상 조절 버튼.. 스윙(swing)

    Date2013.04.23 CategoryDevelop Byhooni Views10207
    Read More
  10. [js] jQjuery $ 활용

    Date2013.12.17 CategoryDevelop Byhooni Views10189
    Read More
  11. [c++] MFC로 만든 디렉토리/파일 파인더

    Date2013.04.23 CategoryDevelop Byhooni Views10177
    Read More
  12. [ios] UUID 생성 + Key Chain 연동

    Date2016.05.13 CategoryDevelop Byhooni Views10177
    Read More
Board Pagination Prev 1 ... 22 23 24 25 26 27 28 29 30 31 ... 71 Next
/ 71