fork download
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <windows.h>
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10. setlocale(LC_ALL, "Russian");
  11. int *arr_one = new int[1];
  12. int x = 0, y, b = 10, value = 0;
  13. while (x != b)
  14. {
  15.  
  16. cout << "Введите число:\n";
  17. cin >> y;
  18. arr_one[x] = y;
  19. cout << "Продолжить любая клавиша,выйти N\n";
  20. value = _getch();
  21. if (value == 'n' || value == 'N') { goto tasta; }else
  22. {
  23. x++;
  24. b++;
  25. int *arr_two = new int[x];
  26. for (int i = 0; i < x; i++)
  27. {
  28. arr_two[i] = arr_one[i];
  29. }
  30. delete []arr_one;
  31. int *arr_one = new int[x];
  32. for (int i = 0; i < x; i++)
  33. {
  34. arr_one[i] = arr_two[i];
  35. }
  36. delete []arr_two;
  37. }
  38.  
  39. }
  40. tasta:
  41. for (int i = 0; i < x; i++)
  42. {
  43. if (arr_one[i] < 0)
  44. arr_one[i] = 0;
  45. }
  46. for (int i = 0; i < x; i++)
  47. {
  48. cout << " " << arr_one[i];
  49. _getch();
  50. }
  51. return 0;
  52. }
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
 #include "stdafx.h"
                    ^
compilation terminated.
stdout
Standard output is empty