fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int commonDenominator(int x,int y){
  6.  
  7. if(((x>y)?x:y) - ((x>y)?y:x) == 0)
  8. return (x<y)?x:y;
  9. else
  10. return commonDenominator(((x>y)?y:x), ((x>y)?x:y) - ((x>y)?y:x));
  11. }
  12. commonDenominator(252, 198)
  13. return 0;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:5:36: error: a function-definition is not allowed here before ‘{’ token
  int commonDenominator(int x,int y){
                                    ^
prog.cpp:12:31: error: ‘commonDenominator’ was not declared in this scope
     commonDenominator(252, 198)
                               ^
prog.cpp:13:2: error: expected ‘;’ before ‘return’
  return 0;
  ^
stdout
Standard output is empty