Problem gcd
User wyaptw
Submission Time 2025-05-22 21:01:06
Score 0
Max Time N/A
Max Memory N/A

Compile Error

gcd.cpp: In function ‘int main()’:
gcd.cpp:10:19: error: expected ‘;’ before ‘for’
10 | while (b>a) b-=a
| ^
| ;
11 | for (int i=1;i<b;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<b;i++) if (a%i==0 and b%i==0 and i%x==0) x = i;
| ^