problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
leetcode::count_operations_to_obtain_zero::Solution类 参考

#include <leetcode.h>

静态 Public 成员函数

static int countOperations (int num1, int num2)
 

详细描述

在文件 leetcode.h1096 行定义.

成员函数说明

◆ countOperations()

int leetcode::count_operations_to_obtain_zero::Solution::countOperations ( int  num1,
int  num2 
)
static

在文件 leetcode.cpp2788 行定义.

2788 {
2789 int count = 0;
2790 while(num1 != 0 && num2 != 0) {
2791 if(num1 > num2) {
2792 count += num1 / num2;
2793 num1 = num1 % num2;
2794 } else {
2795 count += num2 / num1;
2796 num2 = num2 % num1;
2797 }
2798 }
2799 return count;
2800 }

被这些函数引用 leetcode::count_operations_to_obtain_zero::TEST().


该类的文档由以下文件生成: