Develop
2003.04.23 09:45
[c] 최대공약수 알고리즘 (유클릿)
조회 수 8873 댓글 0
# 최대 공약수 구하는 함수
#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(); }
-
[java] 채팅창 처럼.. swing..
-
[c] 압축 알고리즘 소스 및 정리
-
[c++] 레지스트리 등록 예제
-
[c] 함수 요약 (검색해서 쓰세요..)
-
[c++] mfc 이용한 트레이아이콘(TrayIcon) 클래스 예제 프로젝트
-
[c] 지나가는 패킷 잡기
-
[html] SVG(Scalable Vector Graphics) 간단 정리
-
[c++] 윈도우 프로세스뷰어 분석.. ㅋㅋ
-
[js] 초간단 암호화/복호화 소스..
-
[c] 약수/최대공약수/완전수 알고리즘
-
[c] 최대공약수 알고리즘 (유클릿)
-
[js] jQjuery $ 활용