1 #include 2 3 3using namespace std; 4 5 int main() 6 { 7 int a = 15; 8 int b = 6; 9 10 while(a != b) 11 { 12 if(a > b) 13 { 14 a = a - b; 15 } 16 else 17 { 18 b = b - a; 19 } 20 } 21 22 cout << a << endl; 23 cout << b << endl; 24 26 return 0; 22 } 1 #include 2 3 using namespace std; 4 5 int main() 6 { 7 int a = 15; 8 int b = 15; 9 10 while(b !=0) 11 { 12 int c = a % b; 13 a = b; 14 b = c; 15 } 16 17 cout << a << endl; 18 19 return 0; 20 }