• Skip to primary navigation
  • Skip to content
  • Skip to footer
Welcome to the development world of chp Welcome to the development world of chp
  • 주제별 학습
  • 최근 글
  • 도서
  • 태그
    1. 홈
    2. 주제별 학습
    3. 프로그래밍 언어
    4. C++
    5. C++: gcd/lcm
    chp

    chp

    99점이 100점이 되기 위해 일을 더하는 개발자

    • South Korea
    • Website
    • GitHub

    C++: gcd/lcm

    최대 1 분 소요

    목차

    • 개요
    • 예제

    레퍼런스 · C++17

    개요

    • gcd
      • 최대 공약수 계산
    • lcm
      • 최소 공배수 계산

    예제

    • 코드
        #include <iostream>
        #include <numeric>
    
        using namespace std;
    
        int main() {
        	cout << gcd(12, 18) << endl;
        	cout << lcm(12, 18) << endl;
    
        	return 0;
        }
    
    • 실행 결과
        6
        36
    

    태그: C++, gcd, lcm

    주제: C++

    작성일: 2022-10-23

    공유하기

    X Facebook LinkedIn Bluesky
    이전: C++: accumulate/reduce 다음: C++: inclusive_scan/exclusive_scan

    같은 주제의 글

    • C++: 역사
    • C++: 컴파일
    • C++: Hello, World!
    • Boost: 개요
    C++ 전체 보기
    • 팔로우:
    • GitHub
    © 2013 - 2026 Welcome to the development world of chp. 제작 지원: Jekyll & Minimal Mistakes.