Problem gcd
User wyaptw
Submission Time 2025-05-22 20:43:15
Score 0
Max Time N/A
Max Memory N/A

Compile Error

gcd.cpp: In function ‘int main()’:
gcd.cpp:9:16: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
9 | std::cout << max(a,b);
| ^~~
| std::max
In file included from /usr/include/c++/9/algorithm:62,
from gcd.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3468:5: note: ‘std::max’ declared here
3468 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
gcd.cpp:12:19: error: ‘min’ was not declared in this scope; did you mean ‘std::min’?
12 | for (int i = 1;i<min(a,b);i++) if (a%i==0 and b%i==0) x = i;
| ^~~
| std::min
In file included from /usr/include/c++/9/algorithm:62,
from gcd.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3456:5: note: ‘std::min’ declared here
3456 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~