__gcd”: 找不到标识符

跟風遠走 提交于 2020-02-28 17:59:12

__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);
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!