Contents

조회 수 8886 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

# 최대 공약수 구하는 함수

#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. [c] 디피-헬만 키교환(Diffie–Hellman key exchange) 샘플 코드.. ㅋㄷ

    Date2013.04.23 CategoryDevelop Byhooni Views9116
    Read More
  2. [mysql] 양력, 음력 DB데이터

    Date2013.04.23 CategoryDevelop Byhooni Views7818
    Read More
  3. [c] 파일(int fd)에서 개행문자 단위로 읽기 by 후리자

    Date2013.04.23 CategoryDevelop Byhooni Views7157
    Read More
  4. [c] 지폰(gphone) 소스.. 수정(암호화)

    Date2013.04.23 CategoryDevelop Byhooni Views7437
    Read More
  5. [c] 암호 알고리즘 소스..

    Date2013.04.23 CategoryDevelop Byhooni Views8345
    Read More
  6. [c] 시스템 보안 과제.. 시간(amc time) 변경

    Date2013.04.23 CategoryDevelop Byhooni Views7201
    Read More
  7. [switch] 시스코 카탈리스트(Cisco Catalyst) 2950 미러링 설정

    Date2013.04.23 CategoryDevelop Byhooni Views11406
    Read More
  8. [c] 네트워크 보안 프로그래밍 과제 (Server,Agent,Client)

    Date2013.04.23 CategoryDevelop Byhooni Views6480
    Read More
  9. [php] 탐색기와 같은 다이나믹 트리(xml/xsl 이용)

    Date2013.04.23 CategoryDevelop Byhooni Views7169
    Read More
  10. [js] 스타크래프트(starcraft)..

    Date2013.04.23 CategoryDevelop Byhooni Views6647
    Read More
  11. [js] 툴팁.. 좋은거.. (tooltip)

    Date2013.04.23 CategoryDevelop Byhooni Views7066
    Read More
  12. [web] URL 인코딩 방법.. 테이블.. ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views7155
    Read More
Board Pagination Prev 1 ... 47 48 49 50 51 52 53 54 55 56 ... 71 Next
/ 71