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

Compile Error

gcd.cpp: In function ‘int main()’:
gcd.cpp:8:15: error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator%’
8 | if (a==0 or a%b==0) std::cout << b;
| ~^~
| | |
| | double
| double
gcd.cpp:9:20: error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator%’
9 | else if (b==0 or b%a==0) std::cout << a;
| ~^~
| | |
| | double
| double
gcd.cpp:11:41: error: invalid operands of types ‘double’ and ‘int’ to binary ‘operator%’
11 | for (int i=1;i<std::sqrt(a);i++) if (a%i==0 and b%i==0) x = i;
| ~^~
| | |
| | int
| double
gcd.cpp:1