Guest User

Untitled

a guest
Dec 14th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "math.h"
  3. #include "iostream"
  4. using namespace std;
  5.  
  6. int _tmain(int argc, _TCHAR* argv[])
  7. {
  8. float a, b, n;
  9. int massiv[100];
  10. setlocale(LC_ALL,"russian");
  11. cout<<"Введите число элементов массива"<<endl;
  12. cin>>n;
  13. cout<<endl;
  14. for (int j=0; j<n; j++)
  15. {
  16. if (n<100)
  17. {
  18. massiv[j] = rand()%10;
  19. cout<<massiv[j]<<endl;
  20. }
  21. }
  22. cout<<endl;
  23. cout<<"Введите элемент массива А"<<endl;
  24. cin>>a;
  25. cout<<"Введите элемент массива В"<<endl;
  26. cin>>b;
  27. cout<<endl;
  28. cout<<"Элементы массива"<<endl;
  29. for (int i=a; i<b; i++)
  30. {
  31. cout<<massiv[i]<<endl;
  32. }
  33. cout<<endl;
  34. cout<<"Этап второй:"<<endl;
  35. system("pause");
  36. return 0;
  37. }
Add Comment
Please, Sign In to add comment