はじめに
この実験では、C++ の関数を使って2つの数の最大公約数(Greatest Common Divisor: GCD)を求める方法を学びます。GCD は、与えられた2つの数を割り切る最大の数です。再帰的なアプローチを使って関数を実装します。
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
cpp(("C++")) -.-> cpp/ControlFlowGroup(["Control Flow"])
cpp(("C++")) -.-> cpp/IOandFileHandlingGroup(["I/O and File Handling"])
cpp(("C++")) -.-> cpp/SyntaxandStyleGroup(["Syntax and Style"])
cpp(("C++")) -.-> cpp/BasicsGroup(["Basics"])
cpp(("C++")) -.-> cpp/FunctionsGroup(["Functions"])
cpp/BasicsGroup -.-> cpp/variables("Variables")
cpp/BasicsGroup -.-> cpp/operators("Operators")
cpp/BasicsGroup -.-> cpp/strings("Strings")
cpp/ControlFlowGroup -.-> cpp/conditions("Conditions")
cpp/FunctionsGroup -.-> cpp/function_parameters("Function Parameters")
cpp/FunctionsGroup -.-> cpp/recursion("Recursion")
cpp/IOandFileHandlingGroup -.-> cpp/output("Output")
cpp/IOandFileHandlingGroup -.-> cpp/files("Files")
cpp/SyntaxandStyleGroup -.-> cpp/code_formatting("Code Formatting")
subgraph Lab Skills
cpp/variables -.-> lab-96189{{"関数を使って最大公約数を求める"}}
cpp/operators -.-> lab-96189{{"関数を使って最大公約数を求める"}}
cpp/strings -.-> lab-96189{{"関数を使って最大公約数を求める"}}
cpp/conditions -.-> lab-96189{{"関数を使って最大公約数を求める"}}
cpp/function_parameters -.-> lab-96189{{"関数を使って最大公約数を求める"}}
cpp/recursion -.-> lab-96189{{"関数を使って最大公約数を求める"}}
cpp/output -.-> lab-96189{{"関数を使って最大公約数を求める"}}
cpp/files -.-> lab-96189{{"関数を使って最大公約数を求める"}}
cpp/code_formatting -.-> lab-96189{{"関数を使って最大公約数を求める"}}
end