fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. cout<<foo(12,4);
  7. return 0;
  8. }
  9. unsigned foo(unsigned x, unsigned y){
  10. while(true){
  11. x=(x>y)?x%y:x;
  12. y=(x>y)?y:y%x;
  13. if(x==0) return y;
  14. if(y==0) return x;
  15. }}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:6:7: error: ‘foo’ was not declared in this scope
 cout<<foo(12,4);
       ^~~
prog.cpp:6:7: note: suggested alternative: ‘feof’
 cout<<foo(12,4);
       ^~~
       feof
stdout
Standard output is empty