fork(2) download
  1. #include "stdafx.h"
  2. #include <iostream>
  3. using namespace std;
  4. void main()
  5. {
  6. setlocale(LC_ALL, "Russian");
  7. int *str;
  8. int n, i, j;
  9. cout << "Введите размер массива ";
  10. cin >> n;
  11. str = new int[n];
  12. int *y = new int[n / 3];
  13. for (i = 0; i < n; i++)
  14. {
  15. cout << "Введите " << i + 1 << " элемент массива ";
  16. cin >> str[i];
  17. }
  18.  
  19. for (int i = 0; i < n; i += 3)
  20. {
  21. cout << str[i] << endl;
  22.  
  23. y[i / 3] = str[i];
  24. }
  25. int temp;
  26. for (i = 0; i < n - 1; i++)
  27. {
  28. for (j = 0; j < n - i - 1; j++)
  29. {
  30. if (у[j] < у[j + 1])
  31. {
  32. temp = у[j];
  33. у[j] = у[j + 1];
  34. у[j + 1] = temp;
  35. }
  36. }
  37. }
  38. for (i = 0; i < n; i++)
  39. {
  40. cout << у[i] << " ";
  41. }
  42.  
  43. system("pause");
  44. }
  45.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:20: fatal error: stdafx.h: No such file or directory
compilation terminated.
stdout
Standard output is empty