fork download
  1. //Погружение
  2. void siftdown(int *a, int i, int n){
  3. int s = min_child(a, i, n);
  4. std::cout << "min_child called" << std::endl;
  5. while((s != 0) && (a[i] > a[s])){
  6. std::cout << "while loop" << std::endl;
  7. std::swap(i, s);
  8. i = s;
  9. s = min_child(a, i, n);
  10. }
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'void siftdown(int*, int, int)':
prog.cpp:3:27: error: 'min_child' was not declared in this scope
  int s = min_child(a, i, n);
                           ^
prog.cpp:4:2: error: 'cout' is not a member of 'std'
  std::cout << "min_child called" << std::endl;
  ^
prog.cpp:4:37: error: 'endl' is not a member of 'std'
  std::cout << "min_child called" << std::endl;
                                     ^
prog.cpp:6:3: error: 'cout' is not a member of 'std'
   std::cout << "while loop" << std::endl;
   ^
prog.cpp:6:32: error: 'endl' is not a member of 'std'
   std::cout << "while loop" << std::endl;
                                ^
prog.cpp:7:3: error: 'swap' is not a member of 'std'
   std::swap(i, s);
   ^
stdout
Standard output is empty