fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. SortowanieLiczb (int iloscLiczb)
  6. {
  7. int* tablica2 = new int [iloscLiczb];
  8. for ( int i = 0; i < iloscLiczb; i++)
  9. cin>>tablica2[i];
  10.  
  11. for ( int i = 0; i < iloscLiczb/2; i++)
  12. cout<<tablica2[i*2+1]<< " ";
  13.  
  14. for ( int i = 0; i < iloscLiczb/2; i++)
  15. cout<<tablica2[i*2]<< " ";
  16.  
  17. float iloscLiczb2 = iloscLiczb;
  18. if ((iloscLiczb2/2)-(iloscLiczb/2)>0)
  19. cout<<tablica2[iloscLiczb-1];
  20.  
  21. cout<<endl;
  22.  
  23. delete [] tablica2;
  24. tablica2 = NULL;
  25. }
  26.  
  27. int main()
  28. {
  29. int iloscLiczb, iloscTestow;
  30.  
  31. cin >> iloscTestow;
  32. for (int i=0; i<iloscTestow; i++)
  33. {
  34. cin>>iloscLiczb;
  35. SortowanieLiczb (iloscLiczb);
  36. }
  37. }
  38.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2 
4 1 2 3 5
3 9 8 7 
compilation info
prog.cpp:5:32: error: ISO C++ forbids declaration of ‘SortowanieLiczb’ with no type [-fpermissive]
 SortowanieLiczb (int iloscLiczb)
                                ^
prog.cpp: In function ‘int SortowanieLiczb(int)’:
prog.cpp:24:14: warning: control reaches end of non-void function [-Wreturn-type]
     tablica2 = NULL;
              ^
stdout
Standard output is empty