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

Compile Error

gcd.cpp: In function ‘int main()’:
gcd.cpp:10:7: error: expected ‘;’ before ‘for’
10 | b-=a
| ^
| ;
11 | for (int i=1;i<a;i++) if (a%i==0 and b%i==0 and i%x==0) x = i;
| ~~~
gcd.cpp:11:16: error: ‘i’ was not declared in this scope
11 | for (int i=1;i<a;i++) if (a%i==0 and b%i==0 and i%x==0) x = i;
| ^
gcd.cpp:14:7: error: expected ‘;’ before ‘for’
14 | a-=b
| ^
| ;
15 | for (int i=1;i<b;i++) if (a%i==0 and b%i==0 and i%x==0) x = i;
| ~~~
gcd.cpp:15:16: error: ‘i’ was not declared in this scope
15 | for (int i=1;i<b;i++) if (a%i==0 and b%i==0 and i%x==0) x = i;
| ^