Problem gcd
User superG
Submission Time 2025-02-19 16:21:45
Score 0
Max Time N/A
Max Memory N/A

Compile Error

gcd.cpp:5:9: error: ‘a’ was not declared in this scope
5 | int gcd(a, b){
| ^
gcd.cpp:5:12: error: ‘b’ was not declared in this scope
5 | int gcd(a, b){
| ^
gcd.cpp:5:13: error: expression list treated as compound expression in initializer [-fpermissive]
5 | int gcd(a, b){
| ^
gcd.cpp: In function ‘int main()’:
gcd.cpp:15:9: error: ‘a’ was not declared in this scope
15 | cin >> a >> b;
| ^
gcd.cpp:15:14: error: ‘b’ was not declared in this scope
15 | cin >> a >> b;
| ^
gcd.cpp:16:10: error: reference to ‘gcd’ is ambiguous
16 | cout << gcd(a, b);
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:84,
from gcd.cpp:1:
/usr/include/c++/9/numeric:132:5: note: candidates are: ‘template<class _Mn, class _Nn> constexpr std::common_typ