fork download
  1. #include <iostream>
  2. #include "stdio.h"
  3.  
  4. using namespace std;
  5.  
  6. void InsertSort(int *mas, int n) //сортировка вставками
  7.  
  8. {
  9. int i, j, key=0, temp=0;
  10. for (i=0; i<n-1; i++)
  11. {
  12. key=i+1;
  13. temp=mas[key];
  14. for (j=i+1; j>0; j--)
  15. {
  16. if (temp<mas[j-1])
  17. {
  18. mas[j]=mas[j-1];
  19. key=j-1;
  20. }
  21. }
  22. mas[key]=temp;
  23. }
  24.  
  25. }
  26. int main()
  27. {
  28.  
  29. int a[10], b[10];
  30. int k=0;
  31. cout « "Vvedite dlinu chlena" « endl;
  32. for (int i=0;i<10;i++){
  33. cin » a[i];
  34. }
  35. for (int i=0;i<10;i++){
  36. if(a[i]>=0)
  37. {
  38. b[k]=a[i];
  39. k++;
  40. }
  41. }
  42. InsertSort(b, k);
  43.  
  44. for (int i=0;i<k;i++){
  45. cout « b[i] « " ";
  46. }
  47. return 0;
  48. }
  49.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:20: fatal error: iostream: No such file or directory
compilation terminated.
stdout
Standard output is empty