__gcd”: 找不到标识符

__gcd无法调用

求解,明明调用了algorithm的库,但是执行的时候总是报错"__gcd找不到标识符"

#include<iostream>
#include"algorithm"
using namespace std;
class Solution {
public:
	bool canMeasureWater(int x, int y, int z) {
		//int k = __gcd(x, y);
		if (x + y<z)return false;
		if (x == z || y == z || x + y == z)return true;
		return z%__gcd(x, y) == 0;
	}
};
int main() {
	Solution s;
	cout << s.canMeasureWater(3, 4, 5);
}
__gcd”: 找不到标识符__gcd”: 找不到标识符 Liiu_077 发布了1 篇原创文章 · 获赞 0 · 访问量 46 私信 关注
上一篇:统计推断(十) Elimination algorithm


下一篇:Python论文中的绘图(保存成PDF不失真)